Data Structures MCQs (Part-13)

Which of the following is a feature of a stack data structure?

A LIFO
B FIFO
C Random access
D Fixed size

Which of the following is a primary advantage of using a doubly linked list over a singly linked list?

A More memory efficient
B Faster traversal
C Allows two way traversal
D Fixed size

What is the main disadvantage of using an array for dynamic data storage?

A Fixed size
B Slow access time
C Inefficient searching
D No direct access

Which data structure is most efficient for implementing a priority queue?

A Stack
B Queue
C Binary Heap
D Array

What is the time complexity of searching for an element in a balanced binary search tree (BST)?

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

Which of the following is a key feature of a Red Black Tree?

A It is a complete binary tree
B It is always perfectly balanced
C It maintains a set of color rules to ensure balance
D It allows only left rotations

Which of the following is the primary use of a hash table?

A Sorting data
B Searching for elements
C Representing graphs
D Storing ordered data

Which of the following is true about a graph traversal using Depth First Search (DFS)?

A It uses a queue
B It explores all neighbors before moving to the next level
C It explores as deep as possible before backtracking
D It always finds the shortest path

Which of the following operations does a circular queue allow?

A Only insertion at the front
B Only insertion at the rear
C Insertion and deletion at both ends
D Insertion and deletion at one end

Which of the following is a characteristic of a Binary Search Tree (BST)?

A Left child is smaller than the parent node
B Right child is larger than the parent node
C Both A and B
D Parent node can be larger than both children

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²)

Which of the following algorithms is used to find the shortest path in a weighted graph?

A Dijkstra’s Algorithm
B BFS
C Merge Sort
D Quick Sort

What is the primary disadvantage of a linked list compared to an array?

A Larger memory overhead
B Slower access time
C Requires dynamic memory allocation
D Cannot be resized

Which data structure is commonly used to implement undo operations in applications?

A Queue
B Stack
C Linked List
D Tree

Which of the following sorting algorithms is the most efficient in the average case?

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