Skip to content

Commit b0de76e

Browse files
author
Muh. Angga Muttaqien
committed
change variable
1 parent d15c7da commit b0de76e

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

sorting/bubble-sort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def bubble_sort(collection):
1313

1414
def main():
1515
print("=== Bubble Sort (Algorithm) - A simple algorithm that repeatedly steps through the list to be sorted. The algorithm is named for the way smaller or larger elements 'bubble' to the top of the list")
16-
numbers = raw_input("Enter numbers separated by a comma: ")
17-
unsorted = [int(item) for item in numbers.split(',')]
16+
user_input = raw_input("Enter numbers separated by a comma: ")
17+
unsorted = [int(item) for item in user_input.split(',')]
1818
print(bubble_sort(unsorted))
1919

2020
if __name__=='__main__':

sorting/insertion-sort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def insertion_sort(collection):
1515

1616
def main():
1717
print("=== Insertion Sort (Algorithm) - An efficient, general-purpose, comparison-based sorting algorithm which most implementations produce a stable sort. Merge-sort is a divide and conquer algorithm")
18-
numbers = raw_input("Enter numbers separated by a comma: ")
19-
unsorted = [int(item) for item in numbers.split(',')]
18+
user_input = raw_input("Enter numbers separated by a comma: ")
19+
unsorted = [int(item) for item in user_input.split(',')]
2020
print(insertion_sort(unsorted))
2121

2222
if __name__=='__main__':

sorting/merge-sort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def merge_sort(collection):
3737

3838
def main():
3939
print("=== Merge Sort (Algorithm) - An efficient, general-purpose, comparison-based sorting algorithm which most implementations produce a stable sort. Merge-sort is a divide and conquer algorithm")
40-
numbers = raw_input("Enter numbers separated by a comma: ")
41-
unsorted = [int(item) for item in numbers.split(',')]
40+
user_input = raw_input("Enter numbers separated by a comma: ")
41+
unsorted = [int(item) for item in user_input.split(',')]
4242
print(merge_sort(unsorted))
4343

4444
if __name__=='__main__':

sorting/quick-sort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def quick_sort(collection):
1414

1515
def main():
1616
print("=== Quick Sort (Algorithm) - An efficient sorting algorithm, serving as a systematic method for placing the elements of an array in order. It is still commonly used algorithm for sorting which is faster than its main competitors, merge-sort and heap-sort")
17-
numbers = raw_input("Enter numbers separated by a comma: ")
18-
unsorted = [int(item) for item in numbers.split(',')]
17+
user_input = raw_input("Enter numbers separated by a comma: ")
18+
unsorted = [int(item) for item in user_input.split(',')]
1919
print(quick_sort(unsorted))
2020

2121
if __name__=='__main__':

sorting/selection-sort.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def selection_sort(collection):
1717

1818
def main():
1919
print("=== Selection Sort (Algorithm) - A sorting algorithm that has thime complexity, making it inefficient on large lists, and generally performs worse than the other similar sort")
20-
numbers = raw_input("Enter numbers separated by a comma: ")
21-
unsorted = [int(item) for item in numbers.split(',')]
20+
user_input = raw_input("Enter numbers separated by a comma: ")
21+
unsorted = [int(item) for item in user_input.split(',')]
2222
print(selection_sort(unsorted))
2323

2424
if __name__=='__main__':

0 commit comments

Comments
 (0)