Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Faiha - L6
#python 3.5.2 import time # In ascending order # Bubble Sort # Selection Sort # Insertion Sort # sorted unsorted part # Example: [ 54 | {26}, 93, 17, 77, 31 ] # sorted unsorted # -------> [ 26, 54 | 93, 17, 77, 31 ] # -------> [ 26, 54, 93 | 17, 77, 31 ] # -------> [ 17, 26, 54, 93 | 77, 31 ] # Idea: Split the list into 2 parts - sorted and unsorted part # Take the first element in "unsorted part" and # Analyze its location in the "sorted part" # Hints: 1 outer for loop (for picking the first element in unsorted) # and inside 1 inner while loop (sorting analysis) # Homeworks # 1. Bubble sort in descending order (for/while) # 2. Selection sort in descending order (for/while) # 3. Try to (roughly) implement Insertion sort
run
|
edit
|
history
|
help
0
denemeler
linked_lists_2+decisions
Pej
Multi-Layer Neural Networks
5
Lesson 8 updated
Hello
Atur Cara Mizan 2
PyWordQuant
abc python basic