Data Structures Practice MCQs
1. What is the time complexity of accessing an element in an array by index?
A) O(1)
B) O(log n)
C) O(n)
D) O(n²)
2. Which data structure provides random access?
A) Array
B) Linked List
C) Stack
D) Queue
3. Array size in most languages is:
A) Dynamic
B) Fixed
C) Infinite
D) Depends on compiler
4. What happens when you access out-of-bounds index in an array?
A) Null
B) Error
C) Zero
D) Last value
5. Which of these is a disadvantage of arrays?
A) Fast access
B) Random access
C) Fixed size
D) Sequential storage
6. What is the time complexity of inserting at the head of a linked list?
A) O(1)
B) O(n)
C) O(n²)
D) O(log n)
7. Which pointer is used in singly linked list?
A) prev
B) next
C) head
D) rear
8. Which list supports two-way traversal?
A) Singly linked list
B) Doubly linked list
C) Circular linked list
D) Array
9. What is stored in linked list nodes?
A) Data only
B) Address only
C) Data and pointer
D) None
10. Which is not an advantage of linked list?
A) Dynamic size
B) Fast insertion
C) Random access
D) No wastage of space
11. What principle does stack follow?
A) FIFO
B) LIFO
C) FILO
D) Random
12. What happens on stack underflow?
A) Overflow
B) Error
C) Terminate
D) None
13. Stack is best for:
A) Backtracking
B) Searching
C) Sorting
D) Traversing
14. What is time complexity for push/pop?
A) O(1)
B) O(n)
C) O(log n)
D) O(n²)
15. Which of these is NOT an application of stack?
A) Recursion
B) Undo operation
C) Job scheduling
D) Parenthesis matching
16. Queue works on:
A) LIFO
B) FILO
C) FIFO
D) Random
17. What causes overflow in queues?
A) Memory full
B) Front > Rear
C) Rear at last index
D) Front at 0
18. What is circular queue?
A) Queue with circle
B) Front connected to rear
C) Stack type
D) Tree type
19. What is front pointer for empty queue?
A) -1
B) 0
C) 1
D) n
20. Which data structure implements queue efficiently?
A) Array
B) Linked list
C) Tree
D) Stack
21. What is the time complexity of searching in array?
A) O(1)
B) O(log n)
C) O(n)
D) O(n²)
22. Which is not dynamic data structure?
A) Array
B) Linked list
C) Stack (linked)
D) Queue (linked)
23. Which allows both front & rear insertion?
A) Queue
B) Stack
C) Deque
D) Tree
24. Stack overflow occurs when:
A) Stack empty
B) Stack full
C) Queue full
D) Queue empty
25. Linked list is efficient for:
A) Random access
B) Insertion
C) Deletion
D) Both B and C
26. Circular queue avoids:
A) Stack overflow
B) Memory waste
C) Double memory
D) Insertion
27. Which data structure is used in BFS?
A) Stack
B) Queue
C) Linked list
D) Tree
28. Which has fixed size?
A) Array
B) Linked list
C) Stack
D) Queue
29. Deleting head in singly linked list is:
A) O(n)
B) O(1)
C) O(log n)
D) O(n²)
30. Which is not linear data structure?
A) Queue
B) Tree
C) Array
D) Stack
31. Queue used in:
A) Function call
B) CPU Scheduling
C) Backtracking
D) DFS
32. Parenthesis matching uses:
A) Queue
B) Array
C) Stack
D) Linked list
33. Deque supports:
A) Front insertion only
B) Rear insertion only
C) Both
D) Neither
34. Linked list disadvantage:
A) Dynamic size
B) No memory wastage
C) Random access difficult
D) Insert anywhere
35. Stack pointer stores:
A) Data
B) Top address
C) Front
D) Rear
36. Array stored in:
A) Sequential
B) Non-sequential
C) Random
D) Linked
37. Linked list uses:
A) Contiguous memory
B) Non-contiguous memory
C) Block memory
D) Random memory
38. Which allows multiple queues?
A) Circular queue
B) Priority queue
C) Deque
D) Multi-level queue
39. Overflow occurs when:
A) Insert full stack
B) Delete empty queue
C) Insert empty queue
D) Delete full stack
40. Null pointer means:
A) 1
B) -1
C) 0
D) Undefined