Skip to main content

A hybrid bifurcated sorting algorithm using ascending and descending linked lists with BST-accelerated insertion

Project description

bifurcated_sort

A hybrid sorting algorithm that splits the input into two linked lists (ascending and descending), processes non-fitting elements using a BST-assisted insertion strategy, and merges both lists to produce the final sorted output.

📄 Full documentation and detailed walkthrough:
https://balajisuresh1359.github.io/balaji-area/code/bifurcated_insertion_sort.html


Installation

pip install bifurcated_sort

Example Usage

from bifurcated_sort import bfc_sort

arr = [15, 3, 8, 1, 12, 6]
bfc_sort(arr)

print(arr)
# Output: [1, 3, 6, 8, 12, 15]

Benchmark (20,000 random integers)

# Output:
# bfc_sort time: 0.026061058044433594
# sorted() time: 0.001425027847290039

Complexity

  • Time Complexity:
    • Best case: O(n)
    • Average case: O(n log n) to O(n√n)
    • Worst case: O(n²)
  • Space Complexity: O(n)

License

MIT License

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

bifurcated_sort-0.1.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

bifurcated_sort-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file bifurcated_sort-0.1.0.tar.gz.

File metadata

  • Download URL: bifurcated_sort-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for bifurcated_sort-0.1.0.tar.gz
Algorithm Hash digest
SHA256 84cb5812378051f9f6838bc569feae29b438f59a7298baf422395875f94eadc0
MD5 33d8e012045ca8b1a3ceccf2b11daccb
BLAKE2b-256 8db92449469feab77c770b4a039d555e08e5224dab5fc32a9e2447cde3dc692c

See more details on using hashes here.

File details

Details for the file bifurcated_sort-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bifurcated_sort-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fe4d5d8602873ac5f3546eb9c295ea2f26bd84b48ce87e1f42245d36ee06d22
MD5 ebf687cb654d7b8651b086ffaf53cbd0
BLAKE2b-256 ffe4fa577718ee564e4139b3edb440832a13191b44a2d4e78709de010ab1a08e

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