wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Batch 3 - (09/01/2026)

Total questions: 35

Worksheet time: 19mins

Name
Class
Date
1.

What is the use of push operation in stack?

a)

Insertion

b)

Deletion

c)

Display

d)

Print the topmost element

2.

What is the use of pop operation in a stack?

a)

Insertion

b)

Deletion

c)

Display

d)

Prints the topmost element in a stack

3.
Are stacks FIFO or FILO?
a)
FILO
b)
FIFO
c)
LIFO
d)
LILO
4.

Only top element can be accessed in stack

a)

TRUE

b)

FALSE

5.

Stacks have LIFO ordering

a)

TRUE

b)

FALSE

6.

Which of them is an abstract data structure (ADT)?

a)

A) Stacks

b)

B) Queues

c)

Both A and C

d)

C) Functions

7.

LIFO stands for

a)

Last in First Out

b)

First in Last Out

c)

List of Outputs

d)

None of them

8.

Act of adding values into a stack is called

a)

Popping

b)

Pushing

c)

Polling

d)

None

9.

Which of the following statement(s) about stack data structure is/are NOT correct?

a)

Stack data structure can be implemented using linked list

b)

New node can only be added at the top of the stack

c)

The last node at the bottom of the stack has a NULL link

HIDE ANSWER

d)

Stack is the FIFO data structure

10.

If the elements “A”, “B”, “D” and “C” are placed in a stack and are deleted one at a time, in what order will they be removed?

a)

ABCD

b)

ABDC

c)

CDBA

d)

DCAB

11.

Consider the following operation performed on a stack of size 5.


Push(1);

Pop();

Push(2);

Push(3);

Pop();

Push(4);

Pop();

Pop();

Push(5);


After the completion of all operation, the no of element present on stack are

a)

1

b)

3

c)

2

d)

4

12.

In a stack, if a user tries to remove an element from empty stack it is called _________

a)

Underflow

b)

Empty collection

c)

Overflow

d)

Garbage Collection

13.

Which one of the following is an application of Stack Data Structure?

a)

Managing function calls

b)

The stock span problem

c)

Arithmetic expression evaluation

d)

All of the above

14.

List of data in which element can be inserted and removed at the same end is called as __________.

a)

array

b)

stack

c)

linked list

d)

queue

15.

What is the time complexity of this code

int a = 0, i = N;

while (i > 0)

{

a += i;

i /= 2;

}

a)

O(N)

b)

O(Sqrt(N))

c)

O(N / 2)

d)

O(log N)

16.

The complexity of Binary search algorithm is

a)

O(n)

b)

O(log n)

c)

O(n2)

d)

O(n log n)

17.

What is the time complexity of following code:

int a = 0;

for (i = 0; i < N; i++) {

for (j = N; j > i; j--) {

a = a + i + j;

}

}

a)

O(N)

b)

O(N*log(N))

c)

O(N * Sqrt(N))

d)

O(N*N)

18.

What is the time complexity of following code:

int i, j, k = 0;

for (i = n / 2; i <= n; i++) {

for (j = 2; j <= n; j = j * 2) {

k = k + n / 2;

}

}

a)

O(n)

b)

O(nLogn)

c)

O(n^2)

d)

O(n^2Logn)

19.

2. How does a binary search algorithm works?​

a)

Dividing the list into halves until the item is matched with one in the list.​

b)

Starts with the first element and checks the next element consecutively until a match is found.

c)

None of the above​

20.

3. An array with 32 elements is input to a binary search algorithm. How many maximum number of comparisons are performed?​

a)

32

b)

8

c)

16

d)

5

21.

4. An array with 32 elements is input to a linear search algorithm. How many maximum number of comparisons are performed?​

a)

32

b)

8

c)

16

d)

5

22.

5. How is the midpoint of the list calculated in binary search?​

a)

midpoint= round ((first_element+last_element)/2)

b)

midpoint= round ((lower_bound+upper_bound)/2)​

c)

midpoint=(lower_bound+upper_bound)/2​

d)

midpoint= round ((lower_bound+upper_bound))

23.

6. Complete the sentence: In binary search, the lower half of the list is discarded if the value at midpoint is …………………….. item searched.​

a)

less than

b)

equal to

c)

greater than

24.

7. True or False: In binary search, the upper half of the list is discarded if the value at midpoint is greater than item searched.​

a)

true

b)

false

25.

What is the other name for a postfix expression?

a)

a) Normal polish Notation

b)

b) Reverse polish Notation

c)

c) Warsaw notation

d)

d) Infix notation

26.

What is the result of the given postfix expression? abc*+ where a=1, b=2, c=3.

a)

a) 4

b)

b) 5

c)

c) 6

d)

d) 7

27.

What is the result of the following postfix expression?

ab*cd*+ where a=2,b=2,c=3,d=4.

a)

a) 16

b)

b) 12

c)

c) 14

d)

d) 10

28.

Consider the stack

| 5 |

| 4 |

| 3 |

| 2 |.

At this point, ‘*’ is encountered. What has to be done?

a)

a) 5*4=20 is pushed into the stack

b)

b) * is pushed into the stack

c)

c) 2*3=6 is pushed into the stack

d)

d) * is ignored

29.

Evaluate the postfix expression ab + cd/- where a=5, b=4, c=9, d=3.

a)

a) 23

b)

b) 15

c)

c) 6

d)

d) 10

30.

A node in a doubly linked list has at least _____ fields

a)

4

b)

2

c)

3

d)

5

31.

What does it mean when we say that an algorithm X is asymptotically more efficient than Y?

a)

X will always be a better choice for small inputs

b)

X will always be a better choice for large inputs

c)

Y will always be a better choice for small inputs

d)

X will always be a better choice for all inputs

32.

If for an algorithm time complexity is given by O(n) then complexity of it is:

a)

constant

b)

linear

c)

exponential

d)

none of the mentioned

33.

Which of the following case does not exist in complexity theory?

a)

Best case

b)

•Worst case

c)

•Average case

d)

Null case

34.

The worst case complexity for insertion sort is _________

a)

O(n)

b)

O(log n)

c)

•O(n2)

d)

•O(n log n)

35.

If for an algorithm time complexity is given by O(1) then complexity of it is:

a)

•constant

b)

•polynomial

c)

•exponential

d)

•none of the mentioned