
[Deleted Account]
β’about 6 years agoProcess of inserting an element in stack is called ____________.
The postfix form of A*B+C/D is?
In a stack, if a user tries to remove an element from empty stack it is called _________.
The prefix form of A-B/ (C * D β E) is?
Following is an incorrect pseudocode for the algorithm which is supposed to determine whether a sequence of parentheses is balanced: Which of these unbalanced sequences does the above code think is balanced? declare a character stack while ( more input is available) { read a character if ( the character is a '(' ) push it on the stack else if ( the character is a ')' and the stack is not empty ) pop a character off the stack else print "unbalanced" and exit } print "balanced
What is the value of the postfix expression 6 3 2 4 + β *:
Here is an infix expression: 4 + 3*(6*3-12). Suppose that we are using the usual stack algorithm to convert the expression from infix to postfix notation. The maximum number of symbols that will appear on the stack AT ONE TIME during the conversion of this expression?
Choose correct output for the following sequence of operations. push(5) push(8) pop push(2) push(5) pop pop pop push(1) pop
Stack can be implemented using _________ and ________ ?
Stack data structure cannot be used for
When function calls another function then the details of previous function are stored in Stack ?
Postfix form of following expression. D + (E * F)
Which data structure can be used to test a palindrome? example : HANNAH or 101 0 101
Select the appropriate code which tests for a palindrome. A. public static void main(String[] args) { System.out.print("Enter any string:"); Scanner in=new Scanner(System.in); String input = in.nextLine(); Stack stk = new Stack(); for (int i = 0; i < input.length(); i++) { stk.push(input.charAt(i)); } String reverse = ""; while (!stk.isEmpty()) { reverse = reverse + stk.pop(); } if (input.equals(reverse)) System.out.println("palindrome"); else System.out.println("not a palindrome"); } B. public static void main(String[] args) { System.out.print("Enter any string:"); Scanner in=new Scanner(System.in); String input = in.nextLine(); Stack stk = new Stack(); for (int i = 0; i < input.length(); i++) { stk.push(input.charAt(i)); } String reverse = ""; while (!stk.isEmpty()) { reverse = reverse + stk.peek(); } if (input.equals(reverse)) System.out.println("palindrome"); else System.out.println("not a palindrome"); } C. public static void main(String[] args) { System.out.print("Enter any string:"); Scanner in=new Scanner(System.in); String input = in.nextLine(); Stack stk = new Stack(); for (int i = 0; i < input.length(); i++) { stk.push(input.charAt(i)); } String reverse = ""; while (!stk.isEmpty()) { reverse = reverse + stk.pop(); stk.pop(); } if (input.equals(reverse)) System.out.println("palindrome"); else System.out.println("not a palindrome"); } D. NONE
What is the number of moves required in the Tower of Hanoi problem for k disks?