
DSA-21-7-25

Quiz
•
Computers
•
University
•
Medium
Geetha D
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following correctly represents the algorithm for pushing an element onto a stack using an array?
if (top == MAX - 1)
print("Overflow");
else {
top++;
stack[top] = item;
}
if (top == -1)
print("Underflow");
else {
top--;
stack[top] = item;
}
top++;
stack[top] = item;
top--;
stack[top] = item;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What condition indicates stack underflow during a pop operation?
top == MAX
top == 0
top == -1
top > MAX
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of this postfix expression evaluation?
5 3 2 * +
16
11
21
13
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the algorithm for checking if a string has balanced parentheses using a stack?
Traverse the string
Push opening brackets
For each closing bracket, check and pop
If stack is empty at the end → balanced
Push only closing brackets
At end, check if stack size is 2
Ignore brackets
Count them manually
Always return true
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following algorithms can be solved using stack?
Infix to Postfix Conversion
Expression Evaluation
Balanced Parentheses
all the above
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The time complexity of push() and pop() in a stack is:
O(n)
O(n log n)
O(1)
O(log n)
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A stack can be implemented using:
Arrays only
Linked List only
Both Arrays and Linked List
None of the above
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Stack Operations Quiz 1

Quiz
•
University
9 questions
Scratch Vocabulary

Quiz
•
3rd Grade - University
8 questions
Operating Systems - Processes

Quiz
•
University
10 questions
Quiz on Stacks and Data Structures 2

Quiz
•
University
10 questions
Stack

Quiz
•
University
15 questions
STACK - DATA STRUCTURES

Quiz
•
University
10 questions
DAY-3 DSA BOOTCAMP

Quiz
•
University
10 questions
Computer Architecture

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University