AllInfoHub Logo

AllInfoHub – MCQ Practice

Data Structures and Algorithms – Multiple Choice Questions (MCQs)

  1. 25. What is a min-heap?

    • A. A heap where the value of each node is greater than or equal to the value of its children
    • B. A heap where the value of each node is less than or equal to the value of its children
    • C. A binary search tree that is also a heap
    • D. A complete binary tree
  2. 26. What is a max-heap?

    • A. A heap where the value of each node is less than or equal to the value of its children
    • B. A heap where the value of each node is greater than or equal to the value of its children
    • C. A binary search tree that is also a heap
    • D. A complete binary tree
  3. 27. What is a graph data structure?

    • A. A linear collection of nodes
    • B. A hierarchical structure
    • C. A collection of nodes (vertices) and edges that connect them
    • D. A data structure that follows the FIFO principle
  4. 28. What is a directed graph?

    • A. A graph where edges have no direction
    • B. A graph where each edge has a direction
    • C. A graph with only one connected component
    • D. A graph with no cycles
  5. 29. What is an undirected graph?

    • A. A graph where each edge has a direction
    • B. A graph where edges have no direction
    • C. A graph with multiple connected components
    • D. A graph with cycles
  6. 30. What is a weighted graph?

    • A. A graph where edges have associated weights or costs
    • B. A graph where all edges have the same weight
    • C. A directed acyclic graph
    • D. A complete graph
  7. 31. What is Breadth-First Search (BFS)?

    • A. A graph traversal algorithm that explores as far as possible along each branch before backtracking
    • B. A graph traversal algorithm that explores all the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level
    • C. A searching algorithm used in sorted arrays
    • D. A sorting algorithm used in linked lists
  8. 32. What is Depth-First Search (DFS)?

    • A. A graph traversal algorithm that explores all the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level
    • B. A graph traversal algorithm that explores as far as possible along each branch before backtracking
    • C. A searching algorithm used in unsorted arrays
    • D. A data structure used for priority queues
  9. 33. What is the time complexity of Breadth-First Search (BFS) in a graph with V vertices and E edges?

    • A. O(1)
    • B. O(V)
    • C. O(E)
    • D. O(V + E)
  10. 34. What is the time complexity of Depth-First Search (DFS) in a graph with V vertices and E edges?

    • A. O(1)
    • B. O(V)
    • C. O(E)
    • D. O(V + E)
  11. 35. What is a sorting algorithm?

    • A. An algorithm that arranges elements of a list in a certain order
    • B. An algorithm that searches for a specific element in a list
    • C. An algorithm that inserts an element into a list
    • D. An algorithm that deletes an element from a list
  12. 36. Which of the following is a comparison-based sorting algorithm?

    • A. Bubble Sort
    • B. Hashing
    • C. Radix Sort
    • D. Counting Sort