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
  • 7,605
  • 11
  • 49
  • 64

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
  • 199,887
  • 59
  • 344
  • 454