list = [], list = empty list, for i in range(5):, REPEAT 5 times, list.append(int(input("Enter some numbers: "))), append to list(INPUT("Enter some numbers: ")), size = len(list), size = length(list), hole = 0, hole = 0, insertion = 0, insertion = 0, for i in range(size-1):, REPEAT size-1 times, insertion = list[i], insertion = list[index i], hole = i, hole = i, while hole > 0 and list[hole - 1] > insertion:, while hole > 0 AND list[index hole-1] > insertion then, list[hole], list[hole - 1] = list[hole - 1], list[hole], SWAP list[hole], list[hole - 1], hole = hole-1, INCREMENT hole -1, list[hole] = insertion, list[index hole] = insertion, print("Sorted list:", list), OUTPUT(sorted list)
0%
Insertion sort
Share
Share
by
40425089
Edit Content
Save
Like
Print
Embed
More
Assignments
Leaderboard
Show more
Show less
This leaderboard is currently private. Click
Share
to make it public.
This leaderboard has been disabled by the resource owner.
This leaderboard is disabled as your options are different to the resource owner.
Revert Options
Match up
is an open-ended template. It does not generate scores for a leaderboard.
Log in required
Visual style
Fonts
Subscription required
Options
Switch template
Show all
Open results
Copy link
QR code
Delete
Continue editing:
?