๐ญ๐ญuniting the internal work in a way that is in PHP
MIT License
โ๐ณA collection of algorithms that are implemented in PHP๐ณ
โโโPackage
โ โโโ Sort
โ โ โโโ BubbleSort.php
โ โ โโโ QuickSort.php
โ โ โโโ ShellSort.php
โ โ โโโ MergeSort.php
โ โ โโโ InsertSort.php
โ โ โโโ SelectSort.php
โ โ
โ โโโ Query ๆฅๆพ็ฏ
โ โ โโโ BinaryQuery.php
โ โ โโโ InseertQuery.php
โ โ โโโ FibonacciQuery.php
โ โ โโโ BFSQuery.php
โ โ โโโ Kmp.php
โ โ โโโ DijkstraQuery.php
โ โ โโโ QulickQuery.php
โ โ
โ โโโ Other ๅ
ถไป
โ โโโ MonkeyKing.php
โ โโโ DynamicProgramming.php
โ โโโ Fibonacci.php
โ โโโ StealingApples.php
โ โโโ HanoiGames.php
โ โโโ BidirectionalQueue.php
โ โโโ ColorBricks.php
โ โโโ GetCattle.php
โ โโโ OnlyNumbers.php
โ โโโ Interval.php
โ โโโ Maze.php
โ โโโ AntsClimb.php
โ โโโ Encryption.php
โ โโโ ElevatorDispatch.php
โ โโโ kmp.php
โ โโโ TraversalOfBinary.php
โ โโโ PointInTriangle.php
โ โโโ BigSmallReplace.php
โ โโโ Knapsack.php
โ โโโ Solution.php
โ โโโ RotationSort.php
โ โโโ Square.php
โ โโโ Prim.php
โ โโโ CartesianProduct.php
โ โโโ Square.php
โ โโโ Judge.php
โ โโโ Factorial.php
| โโโ HashTable.php
| โโโ RotateSort.php
โ
โโโLICENSE
โโโREADME.md
To record their understanding algorithms, data structure, the process of simple comprehensive and detailed as possible, let the learning algorithm using flexible, refueling(เธ โขฬ_โขฬ)เธ
log10100 It's equivalent to saying, "how many tens do you multiply?" the answer is, of course, two so log10100=2๏ผThe logarithmic operation is the inverse of the power operation
left | right |
---|---|
23 = 8 | log28 = 3 |
24 = 16 | log216 = 4 |
25 = 32 | log232 = 5 |
If you don't, we won't wait for you
Take binary search for example, how much time can you save by using it? Simply look for the Numbers and if the list contains 100 Numbers, you need to guess 100 times.
In other words, the number of guesses is the same as the length of the list, which is called linear time, while binary search is different if the list contains 100 elements
It takes up to seven times, and if the list contains four billion digits, it should be guessed 32 times, while the running time of the subsearch is logarithmic time O(log)
The big O notation is a special representation of how fast the algorithm can be. There's a diaosi. In fact, you often have to copy other people's code. In this case, you know how fast these algorithms are
element | Easy to find | Binary search |
---|---|---|
100 | 100ms | 7ms |
10000 | 10s | 14ms |
1 000 000 000 | 11day | 30ms |
O
said hair is pointed out that how fast algorithms, such as list contains n
element, a simple search need to check each element, so you need to perform n
time operationsO
said O (n) to make this operation
, binary search need to perform logn using large O
said toO(log n)
idea
If you find something wrong, you can initiate a issueor pull request,I will correct it in time
่กฅๅ :ๅ่ตทpull request็commit message่ฏทๅ่ๆ็ซ Commit message ๅ Change log ็ผๅๆๅ
Thanks for the issue or pull request of the following friends:
MIT