Skip to content
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

review chapter 3 #2

Open
rioj7 opened this issue Jul 29, 2021 · 0 comments
Open

review chapter 3 #2

rioj7 opened this issue Jul 29, 2021 · 0 comments

Comments

@rioj7
Copy link

rioj7 commented Jul 29, 2021

  • don't call your variables list, list is a build in type and you loose the constructor
  • in bubble sort add a test if done a swap in a pass, if not => data is sorted
  • no need to return the list because a list is a mutable data structure, make a copy of the list (data[:]) if needed to have different sorted list
  • in insertion sort test for (j >= 0) before testing value in list, -1 is a valid list index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant