Skip to content

Commit de4e2bf

Browse files
ElissaElissa
authored andcommitted
Updating file organization
1 parent 60d09ed commit de4e2bf

9 files changed

Lines changed: 29 additions & 27 deletions

File tree

‎project/bubble.py‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎project/insertion.py‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎project/insertion.pyc‎

-498 Bytes
Binary file not shown.
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,20 @@ def selection_sort( arr ):
1313
arr[smallest_index] = arr[cur_index]
1414
arr[cur_index] = temp
1515

16-
return arr
16+
return arr
17+
18+
19+
# TO-DO: implement the Insertion Sort function below
20+
def insertion_sort( arr ):
21+
# loop through n-1 elements
22+
for i in range(1, len(arr)):
23+
temp = arr[i]
24+
j = i
25+
while j > 0 and temp < arr[j - 1]:
26+
# shift left until correct position found
27+
arr[j] = arr[j - 1]
28+
j -= 1
29+
# insert at correct position
30+
arr[j] = temp
31+
32+
return arr

‎project/quick.py‎

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,16 @@ def merge_sort( arr ):
3434
def merge_sort_in_place(arr):
3535
# TO-DO
3636

37+
return arr
38+
39+
40+
# TO-DO: implement the Quick Sort function below
41+
def quick_sort( arr ):
42+
43+
return arr
44+
45+
46+
# TO-DO: implement the Timsort function below
47+
def timsort( arr ):
48+
3749
return arr

‎project/searching.pyc‎

-1.14 KB
Binary file not shown.

‎project/selection.pyc‎

-553 Bytes
Binary file not shown.

‎project/timsort.py‎

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)