Question: Problem 1 Write a function called isBalanced that takes a string of braces as input and returns true if the braces in the string are
Problem 1 Write a function called isBalanced that takes a string of braces as input and returns true if the braces in the string are balanced. If there are more'than Y or more than in the string, the function should return false. You should make use of the built-in java implementation of the stack data structure under java.util.Stack. Example 1 Input: str "CXito Output: False Example 2 Input: str "O)) Output: True import java.uti1.stack; public class Lab2 ( public static void main (String[] args) String str "()(((())"; boolean ans isbalanced (str); System.out.print1n("Answer"+ ans); I/ Should be False public static boolean isbalanced (String str) Stack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
