Python
Python copied to clipboard
All Algorithms implemented in Python
### Describe your change: I've simplified the binary search . I created a new function called binary_search2 and a list to test the function * [x] Add an algorithm? *...
https://github.com/tugzik001
### Describe your change: * [ ] Add an algorithm? * [x] Fix a bug or typo in an existing algorithm? * [ ] Add or change doctests? -- Note:...
### Summary Implements the Shell Sort algorithm inside `sorts/shell_sort.py`. ### Details - Added Shell Sort function with proper docstring, type hints, and doctests. - Created corresponding unit tests under `tests/sorts/test_shell_sort.py`....
**Overview** This PR fixes issue #13887 by modifying the binary search implementation to return the index of the leftmost occurrence when there are multiple occurrences of the search item in...
### Describe your change: Implemented the Relative Strength Index (RSI) algorithm, which analyses an array of stock prices to indicate whether a stock is overbought or oversold. * [x] Add...
### Repository commit a0b0f41ae134aa1772d33bb930e5a960f9979e8 ### Python version (python --version) Python 3.10.7 ### Dependencies version (pip freeze) appnope==0.1.3 asttokens==2.0.8 backcall==0.2.0 decorator==5.1.1 executing==0.8.3 matplotlib-inline==0.1.6 parso==0.8.3 pexpect==4.8.0 pickleshare==0.7.5 prompt-toolkit==3.0.36 ptyprocess==0.7.0 pure-eval==0.2.2 Pygments==2.14.0 six==1.16.0...
### Repository commit a0b0f41ae134aa1772d33bb930e5a960f9979e8 ### Python version (python --version) Python 3.10.7 ### Dependencies version (pip freeze) appnope==0.1.3 asttokens==2.0.8 backcall==0.2.0 decorator==5.1.1 executing==0.8.3 matplotlib-inline==0.1.6 parso==0.8.3 pexpect==4.8.0 pickleshare==0.7.5 prompt-toolkit==3.0.36 ptyprocess==0.7.0 pure-eval==0.2.2 Pygments==2.14.0 six==1.16.0...
## Description Added a comprehensive implementation of the endianness (byte order) conversion algorithm in Python. The implementation includes byte order swapping for 16/32/64-bit integers and bidirectional bytes ↔ integer conversions...
## Description Implements the CRC32 (Cyclic Redundancy Check 32-bit) hash algorithm, which is widely used for error detection and data integrity verification. ## Changes - Added hashes/crc32.py with complete implementation...