Input can be hardcoded for both of the programs
Question โ 1) Write a program of Balancing Brackets, use a suitable data structure to print whether the string entered is a Balanced Brackets or Unbalanced String
Sample input
( [ [ { } ] ] )
Sample Output
The entered String has Balanced Brackets
Sample Input
( [ [ { } ] ] ) )
Sample Output
The entered Strings do not contain Balanced Brackets
Question 2) Find a pair with a given sum in Binary Search Tree 10,20,30,40,50,60,70
Lowest common Ancestor(20,30)=10 Lowest common Ancestor(40,30)=10 Lowest common Ancestor(60,70)=30 Lowest common Ancestor(20,40)=20
Sum = 130 Pair is (60,70)
If the sum is not found, print nodes are not found.