Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
Loading...
Searching...
No Matches
Data Structures | Functions
dsac::stackqueue Namespace Reference

Definition for a templated ArrayQueue class with fixed capacity. More...

Data Structures

class  ArrayQueue
 
class  queue
 A simplified version of the STL queue class. More...
 
class  stack
 A simplified version of the STL stack class. More...
 

Functions

bool is_matched (const std::string &expression)
 
bool is_html_matched (const std::string &html)
 
template<typename T >
void reverse (T data[], int n)
 

Detailed Description

Definition for a templated ArrayQueue class with fixed capacity.

Code from the chapter "Stacks, Queues, and Deques".

Function Documentation

◆ is_html_matched()

bool dsac::stackqueue::is_html_matched ( const std::string &  html)

Tests if every opening tag has a matching closing tag in HTML string.

Parameters
htmla string representing the html source
Returns
true if properly matched, false otherwise

◆ is_matched()

bool dsac::stackqueue::is_matched ( const std::string &  expression)

Tests if delimiters in the given expression are properly matched.

Parameters
expressiona character string
Returns
true if properly matched, false otherwise

◆ reverse()

template<typename T >
void dsac::stackqueue::reverse ( data[],
int  n 
)

Reverses the contents of the given array.

Parameters
dataan array of elements
nlength of the array