Question
1. Which of the following is not a valid postfix expression? 5 4 + 6 5 4 + - 4 + 5 8 2 +
1. Which of the following is not a valid postfix expression?
5 4 + | |||||||||||||||||
6 5 4 + - | |||||||||||||||||
4 + 5 | |||||||||||||||||
8 2 + 2 / | |||||||||||||||||
all of the above are valid postfix expressions 2. What is the result of evaluating the following postfix expression: 4 8 + 2 *
|
3.
What exception is thrown if the pop method is called on an empty stack?
EmptyStackException | ||
NoSuchElementException | ||
ArrayOutOfBoundsException | ||
EmptyCollectionException | ||
none of the above |
4.
Which of the following methods removes an element from a queue?
enqueue | ||
dequeue | ||
first | ||
pop | ||
push |
5.
Which of the following methods inserts an element into a stack data structure?
enqueue | ||
dequeue | ||
push | ||
pop | ||
peek |
6.
A queue is helpful in implementing a __________________ sort.
insertion | ||
selection | ||
quick | ||
radix | ||
merge |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started