|
ADS
Algorithms and Data Structures
|
The longest balanced strings of parentheses inside a text of \( n \) characters, where open and close are the two parentheses and every other character is neither. More...
#include "ADS/Contract.h"#include <cstddef>#include <string_view>#include <utility>#include <vector>#include "ADS/string/impl/Parentheses.tpp"Go to the source code of this file.
Namespaces | |
| namespace | ADS |
Functions | |
| std::size_t | ADS::longestBalancedSubsequence (std::string_view s, char open='(', char close=')') |
| the length of a longest subsequence of \( s \) that is a balanced string of the parentheses open and close | |
| std::pair< std::size_t, std::size_t > | ADS::longestBalancedSubstring (std::string_view s, char open='(', char close=')') |
| where the leftmost of the longest balanced substrings of \( s \) starts and its length, \( ( 0 , 0 ) \) if there is none | |
The longest balanced strings of parentheses inside a text of \( n \) characters, where open and close are the two parentheses and every other character is neither.
The contracts [see Contract.h]: the substring found is balanced. The functions are defined in Parentheses.tpp.