-
Notifications
You must be signed in to change notification settings - Fork 269
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
Adding Quicksort #314
Adding Quicksort #314
Conversation
Codecov Report
@@ Coverage Diff @@
## master #314 +/- ##
=============================================
+ Coverage 98.874% 98.885% +0.011%
=============================================
Files 25 25
Lines 3021 3052 +31
=============================================
+ Hits 2987 3018 +31
Misses 34 34
|
|
||
lower = kwargs.get('start', 0) | ||
upper = kwargs.get('end', len(array) - 1) | ||
stack, top = [0] * (upper - lower + 1), -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a Stack
class (see below).
class Stack(object): |
Try using the above as stack.
P.S. The iterative version seems nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool I will use the stack there in the program ^ ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@czgdp1807 Yep done |
There is one thing missing in the API which is the acceptance of a function which should select the pivot with respect to which partition should be done. Currently, In addition to the above, please do not use Github as your editor as any commit made on Github triggers Travis CI tests leading to wastage of resources. You may follow the steps below to pull the changes to your system, running tests locally until they pass and then push here.
|
Yes sure I had a copy but I thought using travis would be easier, ok now onwards I will do it local system |
Quicksort
References to other Issues or PRs or Relevant literature
Fixes #273. See
#273
Brief description of what is fixed or changed
This code fixes the quick sort issue on iterative implementation as reference with the site https://www.tutorialspoint.com/python-program-for-iterative-quick-sort
Other comments
Hope this code works fine and if there is any issue ping me, yes this PR also included the SWOC participation