Week 7 - Activity #1 (CC104)

Week 7 - Activity #1 (CC104)

University

20 Qs

quiz-placeholder

Similar activities

Tech Quiz - TECHNOHOLICS2K21

Tech Quiz - TECHNOHOLICS2K21

University

20 Qs

CS8391 Data Structure U.II

CS8391 Data Structure U.II

University

15 Qs

CRYPTERS-ROUND-2

CRYPTERS-ROUND-2

University

20 Qs

Push Down Automata Quiz

Push Down Automata Quiz

University

25 Qs

 Quiz-4: Function & Array

Quiz-4: Function & Array

University

15 Qs

Exploring Stacks in Data Structures

Exploring Stacks in Data Structures

University

16 Qs

Konsep dasar Struktur Data

Konsep dasar Struktur Data

University

20 Qs

Techwiz - ICL2.0 Quiz

Techwiz - ICL2.0 Quiz

University

20 Qs

Week 7 - Activity #1 (CC104)

Week 7 - Activity #1 (CC104)

Assessment

Quiz

Other

University

Medium

Created by

Jerome Escultura

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the main principle that a stack data structure follows?

First In First Out (FIFO)

Last In First Out (LIFO)

Random Access

First Come First Served

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is NOT an operation typically associated with a stack?

Push

Pop

Peek

Insert At Bottom

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

In the context of stacks, what does the push() operation do?

Removes the top element

Adds an element to the bottom

Adds an element to the top

Displays the top element without removing it

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

If a stack follows the LIFO principle, which element will be popped from the following stack [10, 20, 30, 40]?

10

20

30

40

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

In which real-life scenario can a stack be used?

Queue at a bank

Browser's back button

Train scheduling system

Internet routing table

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the result of calling peek() on an empty stack?

Returns null

Throws an exception

Returns the last element

Does nothing

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the time complexity of the push() operation in a stack implemented with an array?

O(1)

O(n)

O(log n)

O(n²)

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?