Search Header Logo

CSF3013 QUIZ 3 (CHAPTER 3 STACK)

Authored by ROSAIDA ROSLY

Information Technology (IT)

University

Used 1+ times

CSF3013 QUIZ 3 (CHAPTER 3 STACK)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Why is a stack described as a LIFO structure?

Elements are accessed randomly

The last inserted element is removed first

The first inserted element is removed first

Elements are sorted automatically

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Why are push and pop restricted to one end of the stack?

To reduce memory usage

To maintain stack order and control operations

To simplify coding syntax

To allow faster searching

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the role of the “top” in a stack?

It stores all elements

It marks the first element inserted

It indicates the current position for insertion and deletion

It stores the bottom element

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Why is stack suitable for recursion?

It sorts recursive calls

It stores function calls and restores them in reverse order

It reduces memory usage

It avoids function calls

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Why is array implementation convenient for stacks?

Arrays allow random insertion

Arrays are sequential and match stack structure

Arrays support multiple data types

Arrays eliminate overflow

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Given stack operations: Push(10), Push(20), Pop(), what is the output?

10

20

Both 10 and 20

No output

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

If top = -1, what happens when POP is executed?

Stack overflow

Stack underflow

Element removed

Top becomes 0

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?