-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
quicksort probabilistic guarantee #13
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
Comments
What does randomization of input means? We are taking data from user input and of course that will be random. Please elaborate your suggestion. |
Before quicksort you should just shuffle the input array, so that you avoid worst-case scenario. I think that this should be fine.
|
@miczal |
Thanks for appreciating the Organisation |
* Create text file for numbers * Create sol2.py * Pythonic version of Problem #16 solution * Update sol2.py * Valid Python code for Python version 2-3 * Update sol2.py
…#935) * Create text file for numbers * Create sol2.py * Pythonic version of Problem TheAlgorithms#16 solution * Update sol2.py * Valid Python code for Python version 2-3 * Update sol2.py
Hi,
I think your implementation of quicksort lacks randomizing of the input. If you shuffle it, you are almost guaranteed to not have O(n^2) time scenario.
The text was updated successfully, but these errors were encountered: