C program to check whether brackets are Balanced in an Equation

This problem is one of the standard use case scenario when learning or practicing Stack as a Data Structure, if we are familiar with the basic operarions with stack like push() and pop(), this problem can be solved very easily. All we need to know is that for every opening bracket there needs to be a closed one.


Example:


Input: (a+b)(a-b)
Output : Balanced

Input : ((a+b)(a-b)
Output : Not Balnced

Solution Approach

The two main operations of a Stack Data Structure i.e Push() and Pop() are us...

 •  0 comments  •  flag
Share on Twitter
Published on November 13, 2020 09:32
No comments have been added yet.