Timeline for Getting a binary search to work in Python
Current License: CC BY-SA 3.0
12 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 5, 2016 at 13:58 | comment | added | B. M. |
beyond your algorithmic problem, two caveats : 1) the execution time is 99% reading the file: so the linear search is the best approach here. 2) If you store passwords in memory, set is better than list : with passwords=set(data), Password in passwords solve your problem in 0(1), when your approach is O( ln(n)) .
|
|
| Feb 5, 2016 at 13:34 | answer | added | Joost | timeline score: 0 | |
| Feb 5, 2016 at 13:26 | answer | added | KIDJourney | timeline score: 0 | |
| Feb 5, 2016 at 13:25 | vote | accept | Community Bot | ||
| Feb 5, 2016 at 13:24 | answer | added | Richard Rublev | timeline score: 0 | |
| Feb 5, 2016 at 13:20 | answer | added | Eamonn McEvoy | timeline score: 0 | |
| Feb 5, 2016 at 13:20 | answer | added | sumit | timeline score: 0 | |
| Feb 5, 2016 at 13:19 | answer | added | kfx | timeline score: 3 | |
| Feb 5, 2016 at 13:06 | comment | added | user5597655 | The binary search never returns true, even if I explicitly search something that I know is in the list. After any search, printing high or low always returns 992352. | |
| Feb 5, 2016 at 13:04 | history | edited | user5597655 | CC BY-SA 3.0 |
added 2635 characters in body
|
| Feb 5, 2016 at 13:04 | comment | added | Cyrbil | What is the problem ? | |
| Feb 5, 2016 at 13:02 | history | asked | user5597655 | CC BY-SA 3.0 |