AllInfoHub Logo

AllInfoHub – MCQ Practice

Data Structures and Algorithms – Multiple Choice Questions (MCQs)

  1. 13. What is a queue?

    • A. A linear data structure that allows insertion and deletion at one end only
    • B. A linear data structure that allows insertion at one end (rear) and deletion at the other end (front)
    • C. A hierarchical data structure
    • D. A non-linear data structure
  2. 14. The operation of adding an element to a queue is called:

    • A. Enqueue
    • B. Dequeue
    • C. Push
    • D. Pop
  3. 15. The operation of removing an element from a queue is called:

    • A. Enqueue
    • B. Dequeue
    • C. Push
    • D. Pop
  4. 16. What is a tree data structure?

    • A. A linear data structure
    • B. A hierarchical data structure consisting of nodes connected by edges
    • C. A non-linear data structure where elements are arranged in a circle
    • D. A data structure that follows the FIFO principle
  5. 17. The topmost node in a tree is called:

    • A. Root
    • B. Leaf
    • C. Child
    • D. Parent
  6. 18. A node with no children is called:

    • A. Root
    • B. Leaf
    • C. Child
    • D. Parent
  7. 19. What is a binary tree?

    • A. A tree where each node has at most one child
    • B. A tree where each node has at most two children
    • C. A tree where each node has exactly two children
    • D. A tree where nodes are arranged in a sorted order
  8. 20. What is a complete binary tree?

    • A. A binary tree where all levels are completely filled except possibly the last level
    • B. which is filled from left to right
    • C. A binary tree where all leaf nodes are at the same level
    • D. A binary tree where each node has exactly two children
  9. 21. What is a full binary tree?

    • A. A binary tree where all levels are completely filled
    • B. A binary tree where each node has either zero or two children
    • C. A binary tree where all leaf nodes are at the same level
    • D. A binary tree that is also a complete binary tree
  10. 22. What is a binary search tree (BST)?

    • A. A binary tree where the left subtree of a node contains only nodes with keys less than the node's key
    • B. and the right subtree contains only nodes with keys greater than the node's key
    • C. A binary tree where nodes are arranged in any order
    • D. A binary tree where all levels are filled
  11. 23. What is the time complexity of searching for an element in a balanced binary search tree?

    • A. O(1)
    • B. O(n)
    • C. O(log n)
    • D. O(n log n)
  12. 24. What is a heap data structure?

    • A. A linear data structure
    • B. A tree-based data structure that satisfies the heap property
    • C. A graph-based data structure
    • D. A data structure that follows the LIFO principle