AllInfoHub Logo

AllInfoHub – MCQ Practice

Data Structures and Algorithms – Multiple Choice Questions (MCQs)

  1. 49. What is a hash function?

    • A. A function that takes an input (key) and produces an output (hash value or index)
    • B. A function that sorts a list
    • C. A function that searches for an element
    • D. A function that deletes an element
  2. 50. What is a collision in hashing?

    • A. When two different keys map to the same hash value
    • B. When an element is not found in the hash table
    • C. When the hash table is full
    • D. When the hash function produces an invalid index
  3. 51. Which of the following is a collision resolution technique?

    • A. Linear Probing
    • B. Binary Search
    • C. Merge Sort
    • D. Depth-First Search
  4. 52. Which of the following is another collision resolution technique?

    • A. Separate Chaining
    • B. Bubble Sort
    • C. Quick Sort
    • D. Breadth-First Search
  5. 53. What is a priority queue?

    • A. A queue where elements are processed based on their priority
    • B. A queue where elements are processed in FIFO order
    • C. A stack-like data structure
    • D. A tree-like data structure
  6. 54. Which data structure is commonly used to implement a priority queue?

    • A. Array
    • B. Linked List
    • C. Heap
    • D. Stack
  7. 55. What is the time complexity of inserting an element into a min-heap?

    • A. O(1)
    • B. O(n)
    • C. O(log n)
    • D. O(n log n)
  8. 56. What is the time complexity of extracting the minimum element from a min-heap?

    • A. O(1)
    • B. O(n)
    • C. O(log n)
    • D. O(n log n)
  9. 57. What is a trie (prefix tree)?

    • A. A tree-like data structure used for efficient retrieval of keys in a dataset
    • B. A binary search tree
    • C. A type of graph
    • D. A linear data structure used for storing strings
  10. 58. Tries are often used for:

    • A. Sorting numbers
    • B. Storing large numerical data
    • C. Implementing dictionaries and autocomplete features
    • D. Graph traversal
  11. 59. What is a segment tree?

    • A. A tree data structure used for efficiently answering range queries over an array
    • B. A binary search tree
    • C. A type of linked list
    • D. A graph traversal algorithm
  12. 60. What is a Fenwick tree (Binary Indexed Tree)?

    • A. A tree data structure that can efficiently update elements and calculate prefix sums in an array
    • B. A balanced binary search tree
    • C. A type of heap
    • D. A graph searching algorithm