0% found this document useful (0 votes)
28 views12 pages

MCQs All Modules Part1

The document contains multiple-choice questions (MCQs) based on data structures, organized into seven modules covering topics such as introduction to data structures, stacks and queues, linked lists, trees, graphs, sorting, and hashing. Each question includes options and the correct answer is provided. The content is designed to align with a university syllabus for data structures.

Uploaded by

Monojit Kar
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)
28 views12 pages

MCQs All Modules Part1

The document contains multiple-choice questions (MCQs) based on data structures, organized into seven modules covering topics such as introduction to data structures, stacks and queues, linked lists, trees, graphs, sorting, and hashing. Each question includes options and the correct answer is provided. The content is designed to align with a university syllabus for data structures.

Uploaded by

Monojit Kar
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/ 12

MCQs Based on Data Structures

University Syllabus
Module 1: Introduction (6L)
1. 1. What is the best case time complexity of Linear Search?

● A) O(n)

● B) O(1)

● C) O(n log n)

● D) O(log n)

Answer: B

2. 2. Which of the following is not an asymptotic notation?

● A) Big-O

● B) Big-Ω

● C) Big-θ

● D) Big-δ

Answer: D

3. 3. In the time-space tradeoff, if we want to reduce space, we usually:

● A) Increase recursion

● B) Use more variables

● C) Increase time complexity

● D) Decrease time complexity

Answer: C
4. 4. What does the term 'elementary data organization' refer to?

● A) Control structures

● B) Algorithm design

● C) Primitive and non-primitive data types

● D) Compiler design

Answer: C

5. 5. Binary search works only on:

● A) Unsorted arrays

● B) Sorted arrays

● C) Linked lists

● D) Hash tables

Answer: B

6. 6. What is the time complexity of binary search in the worst case?

● A) O(n)

● B) O(log n)

● C) O(n log n)

● D) O(1)

Answer: B

7. 7. Time complexity of inserting an element in an array at a specific position is:

● A) O(1)

● B) O(log n)

● C) O(n)
● D) O(n²)

Answer: C

8. 8. What is the goal of analyzing an algorithm?

● A) To write a long code

● B) To optimize runtime and space

● C) To avoid debugging

● D) To design UI

Answer: B

Module 2: Stacks and Queues (8L)


9. 1. Which data structure uses LIFO order?

● A) Queue

● B) Stack

● C) Tree

● D) Graph

Answer: B

10. 2. What is the time complexity of push operation in stack?

● A) O(1)

● B) O(log n)

● C) O(n)

● D) O(n log n)

Answer: A
11. 3. In which data structure insertion and deletion are done at opposite ends?

● A) Stack

● B) Queue

● C) Linked List

● D) Tree

Answer: B

12. 4. What is the worst-case time complexity of enqueue operation in circular queue?

● A) O(1)

● B) O(n)

● C) O(log n)

● D) O(n log n)

Answer: A

13. 5. Which type of queue allows insertion and deletion at both ends?

● A) Simple Queue

● B) Priority Queue

● C) Deque

● D) Circular Queue

Answer: C

14. 6. Which of the following is an application of stack?

● A) Expression Evaluation

● B) Priority Scheduling

● C) BFS
● D) DFS

Answer: A

15. 7. Which of the following queue supports elements with priorities?

● A) Circular Queue

● B) Simple Queue

● C) Deque

● D) Priority Queue

Answer: D

16. 8. The postfix expression is evaluated using which data structure?

● A) Queue

● B) Stack

● C) Tree

● D) Heap

Answer: B

17. 9. Queue works on which principle?

● A) LIFO

● B) FIFO

● C) FILO

● D) LILO

Answer: B

18. 10. Which is the correct way to check stack overflow?


● A) top == -1

● B) top == size - 1

● C) top == 0

● D) top == NULL

Answer: B

19. 11. Which queue implementation avoids the problem of unused space in a simple
queue?

● A) Deque

● B) Double Queue

● C) Circular Queue

● D) Static Queue

Answer: C

20. 12. Priority Queue can be implemented using:

● A) Array

● B) Linked List

● C) Heap

● D) All of the above

Answer: D

21. 13. Which function is used to remove an element from stack?

● A) insert()

● B) enqueue()

● C) delete()
● D) pop()

Answer: D

22. 14. Which function is used to add an element to queue?

● A) pop()

● B) insert()

● C) enqueue()

● D) delete()

Answer: C

23. 15. Which of the following is NOT true about queues?

● A) FIFO structure

● B) Insert at front

● C) Remove from front

● D) Used in scheduling

Answer: B

24. 16. Which data structure is used in recursion?

● A) Queue

● B) Array

● C) Stack

● D) Linked List

Answer: C

Module 3: Linked Lists (6L)


1. Which of the following is true about singly linked list?
A) Each node has two pointers
B) The last node points to the first
C) Each node points to the next node
D) It allows random access
Answer: C

2. What is the time complexity of inserting a node at the beginning of a linked list?
A) O(1)
B) O(n)
C) O(log n)
D) O(n log n)
Answer: A

3. In a doubly linked list, each node has:


A) One pointer
B) Two pointers
C) Three pointers
D) Four pointers
Answer: B

4. Which operation is not efficient in singly linked list?


A) Insertion at beginning
B) Deletion at beginning
C) Deletion at end
D) Traversal
Answer: C

5. Header node is used in:


A) Stack
B) Queue
C) Linked list
D) Tree
Answer: C

6. Circular linked list is better than singly linked list for:


A) Backward traversal
B) Stacks
C) Queues
D) Circular buffers
Answer: D

Module 4: Trees (6L)


1. Which of the following is a non-linear data structure?
A) Array
B) Stack
C) Queue
D) Tree
Answer: D

2. Which tree is used to maintain sorted data for fast lookup?


A) Binary Search Tree
B) AVL Tree
C) Heap
D) Threaded Binary Tree
Answer: A

3. What is the maximum number of children a binary tree node can have?
A) 1
B) 2
C) 3
D) Any number
Answer: B

4. Which tree is balanced using rotations?


A) Binary Tree
B) AVL Tree
C) B Tree
D) Heap
Answer: B

5. Which tree type is used in databases for indexing?


A) AVL Tree
B) Binary Tree
C) B Tree
D) BST
Answer: C

6. What is the height of a complete binary tree with n nodes?


A) log n
B) n
C) √n
D) n log n
Answer: A

✅ Module 5: Graph (6L)


1. Which graph traversal uses a queue?
A) BFS
B) DFS
C) Dijkstra
D) Prim's
Answer: A
2. Which data structure is used in DFS?
A) Queue
B) Stack
C) Heap
D) Priority Queue
Answer: B

3. Kruskal's algorithm is used to find:


A) Shortest path
B) Minimum spanning tree
C) Maximum flow
D) Strong components
Answer: B

4. What is the time complexity of BFS in a graph with V vertices and E edges?
A) O(V)
B) O(E)
C) O(V + E)
D) O(VE)
Answer: C

5. Which graph representation is more space efficient for sparse graphs?


A) Adjacency Matrix
B) Adjacency List
C) Incidence Matrix
D) Path Matrix
Answer: B

6. Prim's algorithm starts from:


A) Any vertex
B) Minimum edge
C) Maximum edge
D) Sorted list
Answer: A

✅ Module 6: Sorting (6L)


1. Which of the following sorting algorithms is not comparison based?
A) Bubble Sort
B) Quick Sort
C) Merge Sort
D) Counting Sort
Answer: D

2. Which sorting algorithm has best-case time complexity O(n)?


A) Selection Sort
B) Insertion Sort
C) Quick Sort
D) Merge Sort
Answer: B

3. Which sort is based on divide and conquer technique?


A) Merge Sort
B) Insertion Sort
C) Bubble Sort
D) Selection Sort
Answer: A

4. Quick sort's average case complexity is:


A) O(n)
B) O(n log n)
C) O(n²)
D) O(log n)
Answer: B

5. Which sorting algorithm performs poorly on already sorted data?


A) Insertion Sort
B) Quick Sort
C) Merge Sort
D) Selection Sort
Answer: B

6. Which sort is best suited for linked lists?


A) Heap Sort
B) Merge Sort
C) Bubble Sort
D) Quick Sort
Answer: B

✅ Module 7: Hashing (2L)


1. What is the purpose of a hash function?
A) Sorting
B) Searching
C) Indexing
D) Mapping keys to indices
Answer: D

2. Which technique handles collisions by using an array of linked lists?


A) Linear probing
B) Separate chaining
C) Quadratic probing
D) Double hashing
Answer: B
3. Which of these is a rehashing method?
A) Changing the hash function
B) Using a bigger table
C) Resizing
D) All of the above
Answer: D

4. In linear probing, the next slot is found by:


A) Using modulo
B) Checking next index
C) Skipping odd indices
D) Jumping to start
Answer: B

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy