Skip to content

added selection sort python algorithme #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions chapters/sorting_searching/selection/code/python/selection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
def selectionList(lst):
for i in range(0, len(lst)):
if i < len(lst):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know what this if statement is doing. Could you please explain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really can't remember what was the purpose of that, and it seems wrong from looking at it now, I'm ashamed of this tbh, I code better than this now I promise

lst[i] = i
return lst
t = [1,0,3,2,6,4,5,9,7,8]
print(selectionList(t))