When to use
- Problems involving arrays containing numbers in a given range and need to sort them
- If the problem asks you to find the missing/duplicate/smallest number in an sorted/rotated array
Mechanism
- Iterate over the array one number at a time
- If the current number you are iterating is not at the correct index
- Swap it with the number at its correct index