Stack Implementation in C

Stack Implementation in C

University

10 Qs

quiz-placeholder

Similar activities

QUIZ 2: INTRODUCTION TO RENEWABLE ENERGY

QUIZ 2: INTRODUCTION TO RENEWABLE ENERGY

University

10 Qs

Understanding Arrays in Programming

Understanding Arrays in Programming

University

10 Qs

Lecture 3 - Financial Modelling Excel

Lecture 3 - Financial Modelling Excel

University

10 Qs

Minecraft

Minecraft

KG - Professional Development

13 Qs

Pertemuan 2 Lab SDA

Pertemuan 2 Lab SDA

University

10 Qs

Quiz Planet (Round-1)

Quiz Planet (Round-1)

University

15 Qs

DSA Launchpad 2.0

DSA Launchpad 2.0

University

9 Qs

SKEE1103 CT#11c: Pointers and Functions

SKEE1103 CT#11c: Pointers and Functions

University

11 Qs

Stack Implementation in C

Stack Implementation in C

Assessment

Quiz

Other

University

Medium

Created by

Karthick M

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a stack in data structure?

A stack is a data structure that allows random access to its elements.

A stack is a non-linear data structure.

A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle.

A stack is a linear data structure that follows the First-In-First-Out (FIFO) principle.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the two main operations performed on a stack?

insert and remove

add and remove

enqueue and dequeue

push and pop

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How is a stack implemented using an array in C?

Using a linked list instead of an array.

Using a queue instead of a stack.

Using a binary tree instead of an array.

Using a fixed-size array and a top variable to keep track of the top element.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of push and pop operations in a stack implemented using an array?

O(log n)

O(n^2)

O(1)

O(n)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the time complexity of accessing the top element of a stack implemented using an array?

O(log n)

O(n)

O(1)

O(n^2)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a stack overflow?

A stack overflow is when a program's variables exceed their maximum size.

A stack overflow is when a program's call stack exceeds its maximum size.

A stack overflow is when a program encounters an infinite loop.

A stack overflow is when a program runs out of memory.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a stack underflow?

An item is popped from a full stack.

An item is popped from an empty stack.

An item is pushed onto an empty stack.

An item is pushed onto a full stack.

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?