Skip to content

Quick sort#12

Open
markreynoso wants to merge 78 commits intomasterfrom
quick_sort
Open

Quick sort#12
markreynoso wants to merge 78 commits intomasterfrom
quick_sort

Conversation

@markreynoso
Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/quick_sort.py
left_mark += 1
right_mark -= 1

num_list[0], num_list[right_mark] = num_list[right_mark], num_list[0]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This...isn't really how quick sort works. You're not swapping values; you're subdividing the input list into two lists based on each value's relationship to the pivot point.

Comment thread src/quick_sort.py


if __name__ == '__main__':
print('\nCASE 1: A small list to be sorted:\n'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You're supposed to have best case, worst case, and an average case in your timing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants