DSA-21-7-25

DSA-21-7-25

University

10 Qs

quiz-placeholder

Similar activities

EC8393_FDS_MODEL EXAM_3_PART B

EC8393_FDS_MODEL EXAM_3_PART B

University

15 Qs

Arsitektur Komputer Pertemuan 12

Arsitektur Komputer Pertemuan 12

University

10 Qs

TOOLS FOR AD & TECHNOLOGY DEVELOPMENT (W4-W6)

TOOLS FOR AD & TECHNOLOGY DEVELOPMENT (W4-W6)

University

10 Qs

M2-M3 VMware ICM 8.0

M2-M3 VMware ICM 8.0

University

15 Qs

Tuples and set

Tuples and set

University

10 Qs

Bài test CTDL

Bài test CTDL

University

10 Qs

Networking Vocab

Networking Vocab

KG - University

10 Qs

Processing Quiz

Processing Quiz

University

13 Qs

DSA-21-7-25

DSA-21-7-25

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

Geetha D

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers