✏️ Explanatory Question

Name the search or sort algorithm that:

  • Makes several passes through the array, selecting the next smallest item in the array each time and placing it where it belongs in the array.
  • At each stage, compares the sought key value with the key value of the middle element of the array.

👁 103 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation

  • Selection Sort: This algorithm makes several passes through the array, each time selecting the smallest item and placing it in its correct position.

  • Binary Search: This algorithm compares the sought key value with the key value of the middle element of the array at each stage to find the desired element.