Insertion Sort

Insertion sort is a simple sorting algorithm in which the sorted array is built one entry at a time.

You are now following this Submission

For example enter a sequence: 7 9 8 3 1

Algorithm will follow the steps as follows:

original sequence: 7 9 8 3 1
Step 1: 7 9 8 3 1
Step 2: 7 8 9 3 1
Step 3: 7 8 9 3 1
Step 4: 7 8 3 9 1
Step 5: 7 3 8 9 1
Step 6: 3 7 8 9 1
Step 7: 3 7 8 1 9
Step 8: 3 7 1 8 9
Step 9: 3 1 7 8 9
Step 10: 1 3 7 8 9
Answer: 1 3 7 8 9

Cite As

x yz (2026). Insertion Sort (https://www.mathworks.com/matlabcentral/fileexchange/27934-insertion-sort), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0