Commit Graph

6 Commits

Author SHA1 Message Date
jbaenaxd
1f65007456
Shortened code (#3855) 2020-11-01 15:38:11 +08:00
percy07
df95f43907 Update quick_select.py (#1523)
* Update quick_select.py

Add Doctests.

* Add typehints

* Don't pre-allocate "smaller" and "larger"
2019-10-30 16:10:30 +01:00
William Zhang
9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
weixuanhu
b6c3fa8992 Interpolation search - fix endless loop bug, divide 0 bug and update description (#793)
* fix endless loop bug, divide 0 bug and update description

fix an endless bug, for example, if collection = [10,30,40,45,50,66,77,93], item = 67.

fix divide 0 bug,  when right=left it is not OK to point = left + ((item - sorted_collection[left]) * (right - left)) // (sorted_collection[right] - sorted_collection[left])

update 'sorted' to 'ascending sorted' in description to avoid confusion

* delete swap files

* delete 'address' and add input validation
2019-05-18 10:59:12 +08:00
ParthS007
0856a61859 Remove Multiple Unused Imports and Variable 2018-10-18 02:58:57 +05:30
fickleEfrit
cb3ff4a8f8 Create quick_select.py 2017-10-09 17:26:27 -04:00