Which of the following is a linear data structure?
A) Stack
B) Tree
C) Graph
D) Hash Table
Answer: A) Stack
Which data structure uses LIFO (Last In First Out) order?
A) Queue
B) Array
C) Stack
D) Linked List
Answer: C) Stack
What is the primary purpose of a queue?
A) To store data randomly
B) To manage tasks in a specific order
C) To allow random access to elements
D) To implement recursion
Answer: B) To manage tasks in a specific order
In which data structure can insertion and deletion be done from both ends?
A) Stack
B) Queue
C) Deque
D) Array
Answer: C) Deque
Which of the following is NOT a characteristic of a linked list?
A) Dynamic size
B) Sequential access
C) Non-contiguous memory allocation
D) Fixed size
Answer: D) Fixed size
What is the time complexity of accessing an element in an array?
A) O(n)
B) O(log n)
C) O(1)
D) O(n^2)
Answer: C) O(1)
Which data structure is best suited for implementing recursion?
A) Stack
B) Queue
C) Linked List
D) Array
Answer: A) Stack
What does a binary tree node typically contain?
A) Data and two child pointers
B) Data and a single child pointer
C) Data only
D) Data and multiple child pointers
Answer: A) Data and two child pointers
Which traversal method visits nodes in the order: left, root, right?
A) Preorder
B) Inorder
C) Postorder
D) Level order
Answer: B) Inorder
What is the maximum number of children a binary tree node can have?
A) One
B) Two
C) Three
D) Any number
Answer: B) Two
Which of the following is a self-balancing binary search tree?
A) AVL Tree
B) Binary Tree
C) Red-Black Tree
D) Both A and C
Answer: D) Both A and C
What is the primary advantage of using a hash table?
A) Sequential access
B) Fast access time
C) Low memory usage
D) Easy implementation
Answer: B) Fast access time
Which of the following is true about a circular linked list?
A) It has a head and tail
B) It can be single or doubly linked
C) The last node points to the first node
D) All of the above
Answer: D) All of the above
Which sorting algorithm has the best average case time complexity?
A) Bubble Sort
B) Quick Sort
C) Selection Sort
D) Insertion Sort
Answer: B) Quick Sort
What is the time complexity of inserting an element in a balanced binary search tree?
A) O(n)
B) O(log n)
C) O(n^2)
D) O(1)
Answer: B) O(log n)
In which data structure are elements added at the back and removed from the front?
A) Stack
B) Queue
C) Linked List
D) Array
Answer: B) Queue
Which of the following operations is NOT typically performed on a stack?
A) Push
B) Pop
C) Enqueue
D) Peek
Answer: C) Enqueue
What is a disadvantage of linked lists compared to arrays?
A) Dynamic size
B) Ease of insertion
C) Random access
D) Memory efficiency
Answer: C) Random access
What type of data structure is used to implement a priority queue?
A) Array
B) Stack
C) Heap
D) Linked List
Answer: C) Heap
Which data structure is best for implementing a function call stack?
A) Array
B) Queue
C) Stack
D) Tree
Answer: C) Stack
In a binary search tree, the left child is always…
A) Greater than the parent
B) Less than the parent
C) Equal to the parent
D) None of the above
Answer: B) Less than the parent
What is the main characteristic of a graph?
A) All elements are connected
B) It consists of nodes and edges
C) It can only have one path between nodes
D) It has a fixed number of nodes
Answer: B) It consists of nodes and edges
Which of the following is a characteristic of a depth-first search?
A) It uses a queue
B) It explores all neighbors before moving deeper
C) It can be implemented using a stack
D) It always finds the shortest path
Answer: C) It can be implemented using a stack
Which of the following data structures can have duplicate elements?
A) Set
B) Stack
C) Queue
D) Both B and C
Answer: D) Both B and C
What is the primary disadvantage of a hash table?
A) Complexity of implementation
B) No support for duplicate keys
C) Poor cache performance
D) All of the above
Answer: D) All of the above
Which of the following is a non-linear data structure?
A) Array
B) Linked List
C) Tree
D) Queue
Answer: C) Tree
What is the space complexity of an array of size n?
A) O(1)
B) O(n)
C) O(n^2)
D) O(log n)
Answer: B) O(n)
Which traversal method visits nodes in the order: root, left, right?
A) Inorder
B) Preorder
C) Postorder
D) Level order
Answer: B) Preorder
In a doubly linked list, each node contains…
A) One pointer to the next node
B) Two pointers, one for the next and one for the previous node
C) Three pointers for child nodes
D) No pointers
Answer: B) Two pointers, one for the next and one for the previous node
Which of the following sorting algorithms has the worst case time complexity of O(n^2)?
A) Merge Sort
B) Quick Sort
C) Bubble Sort
D) Heap Sort
Answer: C) Bubble Sort
What is the average time complexity for searching an element in a binary search tree?
A) O(n)
B) O(log n)
C) O(n^2)
D) O(1)
Answer: B) O(log n)
In which data structure are elements ordered by priority?
A) Stack
B) Queue
C) Priority Queue
D) Linked List
Answer: C) Priority Queue
Which data structure is used to implement breadth-first search?
A) Stack
B) Queue
C) Array
D) Linked List
Answer: B) Queue
What is the primary benefit of using a binary search tree?
A) Fast insertion
B) Fast searching
C) No duplicate values
D) All of the above
Answer: D) All of the above
Which of the following represents a non-linear data structure?
A) Array
B) Stack
C) Graph
D) Queue
Answer: C) Graph
What is the time complexity of deleting the minimum element from a min-heap?
A) O(n)
B) O(log n)
C) O(1)
D) O(n log n)
Answer: B) O(log n)
Which data structure allows for efficient insertion and deletion at both ends?
A) Array
B) Linked List
C) Deque
D) Stack
Answer: C) Deque
What is a key characteristic of a hash function?
A) It must be reversible
B) It should produce a unique output for every input
C) It should distribute keys uniformly across the hash table
D) It must be computationally expensive
Answer: C) It should distribute keys uniformly across the hash table
What is the worst-case time complexity of searching in a balanced binary search tree?
A) O(n)
B) O(log n)
C) O(n^2)
D) O(1)
Answer: B) O(log n)
Which of the following is not a type of linked list?
A) Singly Linked List
B) Doubly Linked List
C) Circular Linked List
D) Hybrid Linked List
Answer: D) Hybrid Linked List
Which traversal of a tree is used to obtain a sorted order of elements?
A) Preorder
B) Postorder
C) Inorder
D) Level Order
Answer: C) Inorder
What data structure is ideal for implementing a function call?
A) Array
B) Stack
C) Queue
D) Tree
Answer: B) Stack
What is the average-case time complexity for insertion in a hash table?
A) O(n)
B) O(log n)
C) O(1)
D) O(n log n)
Answer: C) O(1)
In a binary tree, the maximum number of nodes at level k is given by…
A) k
B) 2^k
C) 2^(k-1)
D) k^2
Answer: B) 2^k
What is a key advantage of using an array over a linked list?
A) Dynamic size
B) Ease of implementation
C) Random access
D) Memory efficiency
Answer: C) Random access
Which data structure is used for implementing backtracking algorithms?
A) Stack
B) Queue
C) Tree
D) Graph
Answer: A) Stack
What is the characteristic of a binary heap?
A) Complete binary tree
B) Height-balanced tree
C) Unordered tree
D) None of the above
Answer: A) Complete binary tree
Basic Concepts
Non-Linear Data Structures MCQs
Sorting and Searching Algorithms MCQs
- Data Structures MCQs 1
- Data Structures MCQs 2
- Data Structures MCQs 3
- Data Structures MCQs 4
- Data Structures MCQs 5
- Stacks Solved MCQs
- Queues MCQs
- pointer mcqs
- Array MCQs