![]() |
TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
generate_parentheses class More...
Public Member Functions | |
| std::vector< std::string > | generate (int n) |
| wrapper interface | |
Private Member Functions | |
| void | makeStrings (std::string str, int n, int closed, int open) |
| function that adds parenthesis to the string. | |
Private Attributes | |
| std::vector< std::string > | res |
| Contains all possible valid patterns. | |
generate_parentheses class
Definition at line 26 of file generate_parentheses.cpp.
| std::vector< std::string > backtracking::generate_parentheses::generate | ( | int | n | ) |
wrapper interface
| n | number of pairs of parentheses |
Definition at line 70 of file generate_parentheses.cpp.
|
private |
function that adds parenthesis to the string.
| str | string build during backtracking |
| n | number of pairs of parentheses |
| closed | number of closed parentheses |
| open | number of open parentheses |
Definition at line 45 of file generate_parentheses.cpp.
|
private |
Contains all possible valid patterns.
Definition at line 28 of file generate_parentheses.cpp.