Multiple choice

Which algorithm would work best to sort data as it arrives, one piece at a time perhaps from a network?

  1. Insertion sort

  2. Quick sort

  3. Merge sort

  4. Selection sort

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Insertion sort is efficient for small datasets or data that is already partially sorted. It is well-suited for online algorithms where data arrives one piece at a time, as it can insert the new element into its correct position in the already sorted prefix.