Skip to content

Commit 6a31512

Browse files
Update
1 parent 376a60b commit 6a31512

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Chapter12/deterministic_selection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ def get_index_of_nearest_median(array_list, first, second, median):
5656

5757

5858

59-
def swap(array_list, first, second):
59+
def swap(array_list, first, index_of_nearest_median):
6060
temp = array_list[first]
61-
array_list[first] = array_list[second]
62-
array_list[second] = temp
61+
array_list[first] = array_list[index_of_nearest_median]
62+
array_list[index_of_nearest_median] = temp
6363

6464

6565

0 commit comments

Comments
 (0)