Home / MCQ Bank / Computer
Computer Introduction To Data Structures

Consider the usual algorithm for determining whether a sequence of parentheses is balanced. Suppose that you run the algorithm on a sequence that contains 2 left parentheses and 3 right parentheses (in some order). The maximum number of parentheses that appear on the stack AT ANY ONE TIME during the computation?

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option B • 2

Related Computer Questions

What is the time complexity of the recursive implementation used to convert a decimal number to its binary equivalent? #include<stdio.h> int arr[31], len = 0; void recursive_dec_to_bin(int n) { if(n == 0 && len == 0) { arr[len++] = 0; return; } if(n == 0) return; arr[len++] = n % 2; recursive_dec_to_bin(n/2); } What is the output of print(k) in the following Python code snippet? k = [print(i) for i in my_string if i not in "aeiou"] print(k) What will be the output of the following C code? double x=3,y= - 6; printf("%lf %lf", fabs(x), fabs(y)); Which tool do you use to create a query object? Which Java class is used to handle concurrent tasks in a multi-threaded environment?