Skip to main content

A multi-thread binary search

Project description


A Multi-Thread Binary search written in Python3 by Devin Wallace


import MultiBinary

print(MultiBinary.binary_search(somelist, someitem))

>>>[[True, 12, 'hello']]


binary_search(somelist, someitem, t_limit=100)

  • somelist this is the list you are searching through, it is set up to handle a 1-dimensional list.
  • someitem this is the item you are searching for within the list.
  • t_limit t_limit is the thread count limit, by default it is set to 100 threads, meaning that there will be 100 searches done simultaneously. consider your machines processing power before altering

binary_search return [[True, 9, 802], [True, 44, 802]] returns a 2D list where

  • [0][0] = boolean if found
  • [0][1] = index in list
  • [0][2] = item searched for


import random, MultiBinary
list = []
for i in range(random.randint(20,100)):

print(MultiBinary.binary_search(list, 369))

>>>[[True, 35, 369], [True, 44, 369]]


pip instal MultiBinary



  • SHA265: 92b8cf64d6701af578275fec82ee627a20bf4b83cfbe98dcc7e77577e0c61001


  • SHA256: 92b8cf64d6701af578275fec82ee627a20bf4b83cfbe98dcc7e77577e0c61001

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for MultiBinary, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size MultiBinary-1.0.0-py3-none-any.whl (3.1 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size MultiBinary-1.0.0.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page