1

I'm looking for instances in the core python 2.x that uses the binary search algorithm. Do you have any quick pointers where to look ?

canadadry
  • 8,115
  • 12
  • 51
  • 68

1 Answers1

2

The bisect module uses a binary search. Here's a link to the source code: http://hg.python.org/cpython/file/2.7/Lib/bisect.py

Most of the rest of the Python core uses either hash tables or linear searches.

Raymond Hettinger
  • 216,523
  • 63
  • 388
  • 485