0% found this document useful (0 votes)
39 views10 pages

Unit 2 MCQ

The document contains multiple choice questions related to data structures, covering topics such as stacks, queues, recursion, and their operations. It includes questions on principles like LIFO and FIFO, time complexities, and specific algorithms. An answer key is provided at the end for reference.

Uploaded by

darshitp1604
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views10 pages

Unit 2 MCQ

The document contains multiple choice questions related to data structures, covering topics such as stacks, queues, recursion, and their operations. It includes questions on principles like LIFO and FIFO, time complexities, and specific algorithms. An answer key is provided at the end for reference.

Uploaded by

darshitp1604
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Data Structures - Multiple Choice Questions

1. Which data structure follows LIFO principle?

a) Queue

b) Stack

c) Array

d) List

2. Which of the following is not a stack operation?

a) push

b) pop

c) peek

d) insert

3. What is the initial value of top in an empty stack?

a) 0

b) 1

c) -1

d) None

4. What is the time complexity of push operation in a stack?

a) O(n)

b) O(1)

c) O(log n)

d) O(n^2)

5. Which data structure is used in recursion internally?

a) Stack

b) Queue

c) Array

d) Linked List

Page 1
Data Structures - Multiple Choice Questions

6. What is the postfix of expression (A+B)*C?

a) AB+C*

b) ABC+*

c) A+BC*

d) A*BC+

7. Which of the following expression is in postfix form?

a) A+B

b) A+B*

c) AB+

d) A+B*C

8. What is the result of postfix expression 5 3 2 * +?

a) 11

b) 10

c) 13

d) 16

9. Which of the following uses stack for implementation?

a) Recursion

b) Queue

c) Priority Queue

d) Hash table

10. Which traversal is naturally recursive?

a) Inorder

b) BFS

c) DFS

d) Topological

Page 2
Data Structures - Multiple Choice Questions

11. Which of the following problems can be solved using recursion?

a) Factorial

b) GCD

c) Tower of Hanoi

d) All of the above

12. Base condition in recursion is used to:

a) Call the function

b) Stop recursion

c) Allocate memory

d) Free memory

13. What is factorial(0)?

a) 0

b) 1

c) Undefined

d) Error

14. Which recursive algorithm is used to solve Tower of Hanoi?

a) Divide and Conquer

b) Greedy

c) Brute Force

d) BFS

15. What is the 5th Fibonacci number (starting from 0)?

a) 3

b) 5

c) 8

d) 13

Page 3
Data Structures - Multiple Choice Questions

16. Which function computes the greatest common divisor using recursion?

a) gcd(a, b)

b) lcm(a, b)

c) max(a, b)

d) factorial(n)

17. Recursive function must have:

a) Infinite loop

b) Looping statement

c) Base case

d) None

18. In recursion, each function call is stored in:

a) Queue

b) Stack

c) Heap

d) Tree

19. Which is not an application of recursion?

a) Sorting

b) Tower of Hanoi

c) Backtracking

d) Compiling

20. How many moves required for 3 disks in Tower of Hanoi?

a) 6

b) 7

c) 8

d) 9

Page 4
Data Structures - Multiple Choice Questions

21. Which data structure follows FIFO principle?

a) Stack

b) Array

c) Queue

d) Tree

22. Which operation is not related to queue?

a) enqueue

b) dequeue

c) push

d) front

23. What is the time complexity of enqueue operation in array queue?

a) O(1)

b) O(n)

c) O(log n)

d) O(n^2)

24. What is front and rear for empty queue?

a) 0

b) -1

c) NULL

d) 1

25. What is circular queue?

a) Linear array

b) Queue with ends connected

c) Double queue

d) Self-sorting queue

Page 5
Data Structures - Multiple Choice Questions

26. What condition shows circular queue is full?

a) rear = size-1

b) front = rear+1

c) rear = front-1

d) front = 0

27. What is the maximum size of circular queue with array size n?

a) n-1

b) n

c) n+1

d) 2n

28. Deque allows insertions and deletions from:

a) Front only

b) Rear only

c) Both ends

d) None

29. Which of the following is not a type of queue?

a) Simple

b) Circular

c) Binary

d) Deque

30. In circular queue, if front = rear, the queue is:

a) Full

b) Empty

c) Overflow

d) Underflow

Page 6
Data Structures - Multiple Choice Questions

31. Which queue gives highest priority item first?

a) Simple Queue

b) Circular Queue

c) Priority Queue

d) Deque

32. Which of the following problem may occur in priority queue?

a) Underflow

b) Starvation

c) Overflow

d) None

33. Deque is also known as:

a) Double Ended Queue

b) Dynamic Queue

c) Circular Queue

d) Linear Queue

34. Which of these is not a real-world application of queues?

a) Call center

b) Printer queue

c) Expression parsing

d) CPU scheduling

35. Which data structure is best for level order traversal of a tree?

a) Stack

b) Queue

c) Array

d) Heap

Page 7
Data Structures - Multiple Choice Questions

36. Which type of queue allows priority-based processing?

a) Simple

b) Deque

c) Priority Queue

d) Circular

37. Which operation deletes item from front in queue?

a) push

b) insert

c) dequeue

d) append

38. Dynamic implementation of queue uses:

a) Arrays

b) Linked List

c) Stack

d) Tree

39. Which queue is used in BFS traversal?

a) Deque

b) Stack

c) Priority Queue

d) Simple Queue

40. What is a limitation of static queue using arrays?

a) Overflow

b) Underflow

c) Fixed size

d) Pointer error

Page 8
Data Structures - Multiple Choice Questions

Answer Key

1. b

2. d

3. c

4. b

5. a

6. a

7. c

8. a

9. a

10. a

11. d

12. b

13. b

14. a

15. b

16. a

17. c

18. b

19. d

20. b

21. c

22. c

23. a

24. b

Page 9
Data Structures - Multiple Choice Questions

25. b

26. b

27. a

28. c

29. c

30. b

31. c

32. b

33. a

34. c

35. b

36. c

37. c

38. b

39. d

40. c

Page 10

You might also like