0% found this document useful (0 votes)
8 views3 pages

Data Structures MCQs With Solutions

Another data structures question

Uploaded by

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

Data Structures MCQs With Solutions

Another data structures question

Uploaded by

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

100 Data Structures MCQs with

Solutions
1. 1. Which data structure uses LIFO order?

 A) Queue
 B) Linked List
 C) Stack
 D) Binary Tree

**Answer:** C) Stack

2. 2. What is the time complexity to search an element in a binary search tree (BST)?

 A) O(n)
 B) O(log n)
 C) O(n^2)
 D) O(1)

**Answer:** B) O(log n)

3. 3. In a max-heap, the smallest element is found:

 A) At the root node


 B) In the leaf nodes
 C) In the right subtree
 D) In the left subtree

**Answer:** B) In the leaf nodes

4. 4. Which data structure is best suited for implementing recursion?

 A) Queue
 B) Stack
 C) Linked List
 D) Tree

**Answer:** B) Stack

5. 5. Which of the following is true about doubly linked lists?


 A) They have nodes with only one pointer.
 B) They only allow traversal in one direction.
 C) They have nodes with two pointers.
 D) They require more memory than a singly linked list.

**Answer:** C) They have nodes with two pointers

6. 6. What is the time complexity of inserting an element at the beginning of a linked list?

 A) O(1)
 B) O(n)
 C) O(log n)
 D) O(n log n)

**Answer:** A) O(1)

7. 7. In which data structure are elements added at one end and removed from the other
end?

 A) Stack
 B) Queue
 C) Binary Tree
 D) Linked List

**Answer:** B) Queue

8. 8. Which sorting algorithm has a best-case time complexity of O(n)?

 A) Selection Sort
 B) Bubble Sort
 C) Quick Sort
 D) Merge Sort

**Answer:** B) Bubble Sort (in case of an already sorted array)

9. 9. Which data structure can efficiently find the smallest/largest element?

 A) Hash Table
 B) Binary Search Tree
 C) Queue
 D) Stack

**Answer:** B) Binary Search Tree


10. 10. Which data structure is used for Breadth-First Search (BFS) in a graph?

 A) Stack
 B) Queue
 C) Array
 D) Linked List

**Answer:** B) Queue

You might also like