← Back

Cyclic Sort

Place numbers in correct index when range 1..n.

sortingcyclic-sortUpdated 2025-09-01

Idea

  • Swap element to index value-1 until position fixed

Use Cases

  • Find missing/duplicate in 1..n arrays