MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / ArePair

Function ArePair

CPP/String/BalanceBrackets.cpp:6–12  ·  view source on GitHub ↗

Function to check whether two characters are opening and closing of same type.

Source from the content-addressed store, hash-verified

4// Function to check whether two characters are opening
5// and closing of same type.
6bool ArePair(char opening,char closing)
7{
8 if(opening == '(' && closing == ')') return true;
9 else if(opening == '{' && closing == '}') return true;
10 else if(opening == '[' && closing == ']') return true;
11 return false;
12}
13bool AreParanthesesBalanced(string exp)
14{
15 stack<char> S;

Callers 1

AreParanthesesBalancedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected