Skip to main content

A multi-thread binary search

Project description

MultiBinary

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

Usage

import MultiBinary

print(MultiBinary.binary_search(somelist, someitem))

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

Methods

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

Testing

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

print(MultiBinary.binary_search(list, 369))

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

Installing

pip instal MultiBinary

Hashes

MultiBinary-1.0.0.tar.gz

  • SHA265: 92b8cf64d6701af578275fec82ee627a20bf4b83cfbe98dcc7e77577e0c61001

MultiBinary-1.0.0-py3-none-any.whl

  • 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.

Source Distribution

MultiBinary-1.0.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

MultiBinary-1.0.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file MultiBinary-1.0.0.tar.gz.

File metadata

  • Download URL: MultiBinary-1.0.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0

File hashes

Hashes for MultiBinary-1.0.0.tar.gz
Algorithm Hash digest
SHA256 79866f61d4cebbd65a6e2cb78fce0e791b2e2941041b609f11fef90c9b63baea
MD5 793917ad87125ff70c44bd29d255ec0e
BLAKE2b-256 b521b8251679173e976103ba76ea7fbfb0a5c498b8a1d98a8490e20e72b4ef2f

See more details on using hashes here.

File details

Details for the file MultiBinary-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: MultiBinary-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.0

File hashes

Hashes for MultiBinary-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee4229a140cd18796dc31f72e9def844258adbc3d2fff08105a1cbe5ed9f45db
MD5 9254c0e8cf1e2482767786405384ff97
BLAKE2b-256 a1d20a7a09c99f100919b72b23a52c309e0ec90d969edf464ecc3d19589aa659

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page