AllInfoHub Logo

AllInfoHub – MCQ Practice

Data Structures and Algorithms – Multiple Choice Questions (MCQs)

  1. 37. What is the time complexity of Bubble Sort in the worst case?

    • A. O(1)
    • B. O(n)
    • C. O(log n)
    • D. O(n^2)
  2. 38. What is the time complexity of Insertion Sort in the worst case?

    • A. O(1)
    • B. O(n)
    • C. O(log n)
    • D. O(n^2)
  3. 39. What is the time complexity of Selection Sort in the worst case?

    • A. O(1)
    • B. O(n)
    • C. O(log n)
    • D. O(n^2)
  4. 40. What is the time complexity of Merge Sort in the worst case?

    • A. O(1)
    • B. O(n)
    • C. O(n log n)
    • D. O(n^2)
  5. 41. What is the time complexity of Quick Sort in the average case?

    • A. O(1)
    • B. O(n)
    • C. O(n log n)
    • D. O(n^2)
  6. 42. What is the time complexity of Heap Sort in the worst case?

    • A. O(1)
    • B. O(n)
    • C. O(n log n)
    • D. O(n^2)
  7. 43. Which sorting algorithm has the best average-case time complexity?

    • A. Bubble Sort
    • B. Insertion Sort
    • C. Merge Sort
    • D. Quick Sort
  8. 44. What is a searching algorithm?

    • A. An algorithm that arranges elements of a list
    • B. An algorithm that finds a specific element in a list
    • C. An algorithm that inserts elements
    • D. An algorithm that deletes elements
  9. 45. What is linear search?

    • A. A search algorithm that starts at the beginning of a list and goes through each element until the target element is found
    • B. A search algorithm that repeatedly divides the search interval in half
    • C. A search algorithm used in trees
    • D. A search algorithm used in graphs
  10. 46. What is binary search?

    • A. A search algorithm that starts at the beginning of a list
    • B. A search algorithm that repeatedly divides the search interval in half
    • C. A search algorithm used in linked lists
    • D. A search algorithm used in stacks
  11. 47. For binary search to work, the list must be:

    • A. Sorted
    • B. Unsorted
    • C. Empty
    • D. Partially sorted
  12. 48. What is hashing?

    • A. A searching technique that uses a hash function to map keys to values in a hash table
    • B. A sorting technique
    • C. A data compression technique
    • D. A memory management technique