Metadata-Version: 2.4
Name: bifurcated_sort
Version: 0.2.0
Summary: A hybrid bifurcated sorting algorithm using ascending and descending linked lists with BST-accelerated insertion
Author-email: Balaji <balajisuresh1359@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Balaji
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://balajisuresh1359.github.io/balaji-area/code/bifurcated_insertion_sort.html
Project-URL: Documentation, https://balajisuresh1359.github.io/balaji-area/code/bifurcated_insertion_sort.html
Project-URL: Repository, https://github.com/balajisuresh1359/bifurcated_sort
Project-URL: Issues, https://github.com/balajisuresh1359/bifurcated_sort/issues
Keywords: sorting,algorithm,bifurcated,linked-list,BST,hybrid-sort
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# 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
```bash
pip install bifurcated_sort
```

---

## Example Usage
```python
from bifurcated_sort import bfc_sort, bfc_sorted

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

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

result = bfc_sort([5, 2, 8], inplace=False, reverse=True)
result
# Output:  [8, 5, 2]

arr2 = [2, 1, 32]
result = bfc_sorted(arr)
result
# Output:  [1, 2, 32] #  inplace false by default

arr2
# Output:  [2, 1, 32]
```

---

## Benchmark (20,000 random integers)
```python
# 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
