* fix: space count in strings/word_occurrence.py
* Update strings/word_occurrence.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update strings/word_occurrence.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update strings/word_occurrence.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update word_occurrence.py
Seems like, there is no need o `occurrence.pop('', None)`
Co-authored-by: Christian Clauss <cclauss@me.com>
* Create Python/bit_manipulation/README.md
To open up a new area of algorithms...
@Shrutikabansal I hope that you will contribute some of your work here.
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* CONTRIBUTING.md: What is an Algorithm?
We are seeing too many _how-to examples_ for using existing Python packages so we should define what we want algorithm contributions to be.
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Rename math/add.py to maths/add.py
* fixup! Format Python code with psf/black push
* Fix sum to add
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: John Law <johnlaw.po@gmail.com>
* Text exception conditions
These are ValueErrors, not AttributeErrors.
* fixup! Format Python code with psf/black push
* Update perceptron.py
* Update perceptron.py
* Update perceptron.py
* Revert the test
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Create Python/quantum/README.md
Started at #1831
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* With all suggested changes ✅
possibly covered all the recommended guidelines
* Updated with both slow and faster algorithms
possibally covered all the recomendations
* removed the time comparision part!
* Update data_structures/stacks/next_greater_element.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update data_structures/stacks/next_greater_element.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update data_structures/stacks/next_greater_element.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Update data_structures/stacks/next_greater_element.py
Co-Authored-By: Christian Clauss <cclauss@me.com>
* Add benchmark using timeit
https://docs.python.org/3/library/timeit.html
The performance delta between these two implementation is quite small...
```
next_greatest_element_slow(): 1.843442126
next_greatest_element(): 1.828941414
```
* Optimize slow() to create fast() - Three algorithms in the race
Three algorithms in the race
* Use a bigger test array with floats, negatives, zero
* Setup import next_greatest_element_fast
Co-authored-by: Christian Clauss <cclauss@me.com>
* Fix rehashing function will not call insert_data function
* Fix typo
* Update loop syntax instead of allocating a list
Co-Authored-By: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
* Add Monte Carlo estimation of PI
* Add type annotations for Monte Carlo estimation of PI
* Compare the PI estimate to PI from the math lib
* accuracy -> error
* Update pi_monte_carlo_estimation.py
Co-authored-by: John Law <johnlaw.po@gmail.com>
* autoblack: actions/checkout@v1 # Use v1, NOT v2
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Added Random Forest Regressor
* Updated file to standard
* Added Random Forest Classifier (Iris dataset) and a Confusion Matrix for result visualization
* spelling corrections
* review
* improved documentation, removed redundant variables, added testing
* added type hint
* camel case to snake case
* spelling fix
* review
* python --> Python # it is a brand name, not a snake
* explicit cast to int
* spaces in int list
* "!= None" to "is not None"
* Update comb_sort.py
* various spelling corrections in documentation & several variables naming conventions fix
* + char in file name
* import dependency - bug fix
Co-authored-by: John Law <johnlaw.po@gmail.com>