Stacks and Queues Quiz

Quiz
•
Computers
•
University
•
Hard
Summia H
Used 64+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a stack, if a user tries to remove an element from an empty stack it is called _________
Underflow
Empty collection
Overflow
Garbage Collection
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of the postfix expression 6 3 2 4 + - *?
1
40
74
-18
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following postfix expression with single digit operands is evaluated using a stack: 8 2 3 ^ / 2 3 * + 5 1 * - Note that ^ is the exponentiation operator. The top two elements of the stack after the first * is evaluated are:
3,2
1,5
6,1
5,7
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Assume that the operators +, -, × are left associative and ^ is right associative. The order of precedence (from highest to lowest) is ^, x , +, -. The postfix expression corresponding to the infix expression a + b × c - d ^ e ^ f is
abc × + def ^ ^ -
abc × + de ^ f ^ -
ab + c × d - e ^ f ^
+ a × bc ^ ^ def
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To evaluate an expression without any embedded function calls : As many stacks as the height of the expression tree are needed One stack is enough Two stacks are needed A Turing machine is needed in the general case
As many stacks as the height of the expression tree are needed
One stack is enough
Two stacks are needed
A Turing machine is needed in the general case
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The result evaluating the postfix expression 10 5 + 60 6 / * 8 - is
284
213
142
71
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A function f defined on stacks of integers satisfies the following properties. f(∅) = 0 and f (push (S, i)) = max (f(S), 0) + i for all stacks S and integers i.If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is f(S)?
6
4
3
2
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Post Test ASJ 11 Genap

Quiz
•
University
17 questions
Stacks

Quiz
•
KG - Professional Dev...
15 questions
Web Development Quiz

Quiz
•
12th Grade - University
10 questions
DSA(UNIT 1) Test 1

Quiz
•
University
10 questions
DATA STRUCTURE QUIZ 1- INTRO TO DATA STRUCTURES

Quiz
•
University
20 questions
Data Structures

Quiz
•
University - Professi...
20 questions
DATA STRUCTURES

Quiz
•
University
20 questions
PROGRAMMING IN C AND DATA STRUCTURES - UNIT V

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University