Site icon T4Tutorials.com

Operations: traversal, insertion, deletion MCQs

1. : What is traversal in the context of data structures?

(A) Adding an element to the data structure


(B) Removing an element from the data structure


(C) Accessing and processing each element of the data structure


(D) Sorting the elements of the data structure



2. : Which traversal technique visits the left subtree, then the root, and finally the right subtree in a binary tree?

(A) Preorder traversal


(B) Inorder traversal


(C) Postorder traversal


(D) Level order traversal



3. : Which traversal method is used in depth-first search (DFS) of a graph?

(A) Inorder traversal


(B) Preorder traversal


(C) Postorder traversal


(D) Any of the above



4. : In a linked list, which operation requires traversal to reach the desired position?

(A) Insertion at the head


(B) Deletion at the head


(C) Insertion at the tail


(D) All of the above



5. : What is the time complexity of traversing an array of size n?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n^2)



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

(A) O(1)


(B) O(n)


(C) O(log n)


(D) O(n^2)



7. : In an array, what is the time complexity of inserting an element at the end?

(A) O(1)


(B) O(n)


(C) O(log n)


(D) O(n^2)



8. : What is the time complexity of inserting an element at a specific position in an array of size n?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n^2)



9. : In a binary search tree (BST), what is the average time complexity of inserting an element?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n^2)



10. : In a heap, what is the time complexity of inserting an element?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n^2)



11. : What is the time complexity of deleting the first element of a singly linked list?

(A) O(1)


(B) O(n)


(C) O(log n)


(D) O(n^2)



12. : In an array, what is the time complexity of deleting an element from a specific position?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n^2)



13. : What is the time complexity of deleting an element from the end of an array of size n?

(A) O(1)


(B) O(n)


(C) O(log n)


(D) O(n^2)



14. : In a binary search tree (BST), what is the average time complexity of deleting an element?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n^2)



15. : What is the time complexity of deleting the root element in a max heap?

(A) O(1)


(B) O(log n)


(C) O(n)


(D) O(n^2)



16. : Which data structure allows insertion, deletion, and traversal in O(1) time complexity?

(A) Array


(B) Singly linked list


(C) Doubly linked list


(D) None of the above



17. : Which of the following data structures supports O(1) time complexity for both insertion and deletion at the beginning?

(A) Array


(B) Stack


(C) Queue


(D) Singly linked list



18. : Which traversal method is typically used to display elements of a binary search tree in ascending order?

(A) Preorder


(B) Inorder


(C) Postorder


(D) Level order



19. : In which data structure does insertion and deletion take O(1) time but traversal takes O(n) time?

(A) Stack


(B) Queue


(C) Linked list


(D) Binary search tree



20. : What is the time complexity of inserting an element in the middle of a linked list?

(A) O(1)


(B) O(n)


(C) O(log n)


(D) O(n log n)



 

 

Data Structures MCQs

Basic Concepts

  1. Introduction to Data Structures
  2. Complexity Analysis MCQs

Linear Data Structures MCQs

  1. Arrays MCQs
  2. Linked Lists MCQs
  3. Stacks MCQs
  4. Queues MCQs

Non-Linear Data Structures MCQs

  1. Trees MCQs
  2. Heaps MCQs
  3. Graphs MCQs

Hashing MCQs MCQs

  1. Hash Tables

Sorting and Searching Algorithms MCQs 

  1. Sorting Algorithms MCQs
  2. Searching Algorithms MCQs

Miscellaneous

  1. Memory Management in data structures MCQs
  2. String Manipulation Algorithms MCQs
  1. Data Structures MCQs 1
  2. Data Structures MCQs 2
  3. Data Structures MCQs 3
  4. Data Structures MCQs 4
  5. Data Structures MCQs 5
  6. Stacks Solved MCQs
  7. Queues MCQs
  8. pointer mcqs
  9. Array MCQs

 

Exit mobile version