Commit Graph

16 Commits

Author SHA1 Message Date
cschuerc
81f077adfc Augment binary search algorithms (#1719) 2020-01-28 22:33:59 +05:30
GeorgeChambi
9eb50cc223 Improved readability (#1615)
* improved readability

* further readability improvements

* removed csv file and added f
2019-12-07 06:39:59 +01:00
Du YuanChao
0da4d0a7f3 make code more readable (#1304) 2019-10-08 13:22:40 +05:00
William Zhang
9eac17a408 psf/black code formatting (#1277) 2019-10-05 10:14:13 +05:00
Christian Clauss
47a9ea2b0b
Simplify code by dropping support for legacy Python (#1143)
* Simplify code by dropping support for legacy Python

* sort() --> sorted()
2019-08-19 15:37:49 +02:00
wuminbin
b7cff04574 better implementation for midpoint (#914) 2019-06-24 18:11:07 +08:00
weixuanhu
7677c37011 update 'sorted' to 'ascending sorted' in comments (#789)
To avoid confusion all 'sorted' to 'ascending sorted' in comments
2019-05-06 17:54:31 +08:00
Ant Fitch
53681f199c
Fixed error in binary_search_by_recursion
In binary_search_by_recursion, if you search array for a value that does not exist, you will get this error:
RecursionError: maximum recursion depth exceeded in comparison

To fix this, first check to make sure that the value is between left and right points like this:
    if (right < left):
        return None

A similar construct has already been applied to binary_search, but did not exist in the recursive alternative.
2018-01-30 18:50:07 -08:00
cclauss
4e06949072 Modernize Python 2 code to get ready for Python 3 2017-11-25 10:23:50 +01:00
Sarbajit Saha
d70b9268fe fixed spelling of coma to comma 2017-10-15 21:25:54 +05:30
Sachin Arora
85c1e03b63 Merge pull request #149 from KyleScharnhorst/master
Fix: typo in multiple files.
2017-10-13 21:32:42 +05:30
nandujkishor
e0211794da Changed the typographical error (#132)
Changed the typo in line 113 and 115 regarding recursive binary search algorithm, found by a user who commented in comments.
2017-10-13 20:33:40 +05:30
TaylorL19
8f71b30995 Fixed binary search to correctly recurse to left half and right half 2017-10-10 11:57:16 -05:00
KyleScharnhorst
014786e340 Fix: typo in multiple files. 2017-10-07 06:47:50 -07:00
ZivLi
23ac6bc1b5 Add bin-search implement by recursion 2017-07-05 16:40:18 +08:00
Sergey Tsaplin
ab2614574e Move files to separate directories 2016-08-01 15:06:53 +05:00