mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-19 21:19:47 +00:00
* In place of calculating the factorial several times we can run a loop k times to calculate the combination for example: 5 C 3 = 5! / (3! * (5-3)! ) = (5*4*3*2*1)/[(3*2*1)*(2*1)] =(5*4*3)/(3*2*1) so running a loop k times will reduce the time complexity to O(k) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update maths/combinations.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
In place of calculating the factorial several times we can run a loop k times to calculate the combination (#10051)
Implementations are for learning purposes only. They may be less efficient than the implementations in the Python standard library. Use them at your discretion.
Getting Started
Read through our Contribution Guidelines before you contribute.
Community Channels
We are on Discord and Gitter! Community channels are a great way for you to ask questions and get help. Please join us!
List of Algorithms
See our directory for easier navigation and a better overview of the project.
Description
All Algorithms implemented in Python
the-algorithms.com/
algorithmalgorithm-competitionsalgorithms-implementedalgoscommunity-driveneducationhacktoberfestinterviewlearnpracticepythonsearchessorting-algorithmssorts
Readme
418 MiB
Languages
Python
99.9%
Shell
0.1%