recategorized by
548 views
1 votes
1 votes

Which of the following is an applications of a stack

  1. Reversal of a string.
  2. Checking validity of an expression containing nested parameters.
  3. Conversion of infix expression to postfix expression form.
  4. We can't evaluate prefix expression using stack.

 

  1. I, II and III
  2. I and II
  3. I, II and IV
  4. I, II, III and IV
recategorized by

1 Answer

1 votes
1 votes
Applications of stack:
1. Reversal of string: We can reverse a string by pushing each character of the string on the stack. After the whole string is pushed on the stack, we can start popping the characters from the stack and get the reversed string.
2. We can use stack to check the validity of an expression that uses nested parentheses.
3. We can use stack to converting infix expression to postfix expression using stack.
4. False, because We can evaluate prefix expression using stack same like postfix evaluation.
Answer:

Related questions

1 votes
1 votes
0 answers
1
Applied Course asked Jan 16, 2019
955 views
What is the maximum number of activation records inserted into stack while converting following infix expression to postfix expression is Infix expression: $\text{7+5*3^2...