Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 1f23338

Browse files
Update insertion_sort.py
1 parent bcc9398 commit 1f23338

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sorting/insertion_sort.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
3-
# author: bt3gl
43

5-
def insertion_sort(lst):
64

7-
for i in range(1, len(lst)):
5+
def insertion_sort(array):
6+
7+
for i in range(1, len(array)):
88
current_index = i
99

10-
while current_index > 0 and lst[current_index - 1] > lst[current_index]:
10+
while current_index > 0 and array[current_index - 1] > array[current_index]:
1111

12-
lst[current_index], lst[current_index - 1] = lst[current_index - 1], lst[current_index]
12+
array[current_index], array[current_index - 1] = array[current_index - 1], array[current_index]
1313
current_index -= 1

0 commit comments

Comments
 (0)