TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Perform paranthesis matching. More...
#include <iostream>
#include <cstring>
Go to the source code of this file.
Macros | |
#define | MAX 100 |
Functions | |
char | opening (char ch) |
int | main () |
char | stack [MAX] |
int | stack_idx = -1 |
pointer to track stack index | |
void | push (char ch) |
push byte to stack variable | |
char | pop () |
pop a byte out of stack variable | |
Perform paranthesis matching.
Definition in file paranthesis_matching.cpp.
#define MAX 100 |
check number
Definition at line 16 of file paranthesis_matching.cpp.
int main | ( | void | ) |
Definition at line 50 of file paranthesis_matching.cpp.
char opening | ( | char | ch | ) |
return opening paranthesis corresponding to the close paranthesis
[in] | ch | closed paranthesis character |
Definition at line 36 of file paranthesis_matching.cpp.
char pop | ( | ) |
pop a byte out of stack variable
Definition at line 29 of file paranthesis_matching.cpp.
void push | ( | char | ch | ) |
push byte to stack variable
Definition at line 26 of file paranthesis_matching.cpp.
char stack[MAX] |
-----------— stack -----------— global stack
Definition at line 20 of file paranthesis_matching.cpp.
int stack_idx = -1 |
pointer to track stack index
Definition at line 23 of file paranthesis_matching.cpp.