Having good knowledge of standard algorithms is equally important as choosing the right data structure. The following is a list of the top 5 algorithms every programmer should know about.
1. Sort Algorithms
Sorting the most extensively researched topic in computer science. The idea is to list in a particular order.
2. Search Algorithm
On sorted datasets, binary search is used to perform a very efficient search. The idea is to repeatedly divide the portion of the list that could contain the item in half until we are left with one possible item.
3. Hashing
Hash lookup is currently the most popular method for locating relevant data by key or ID. We gain access to data through its index. Earlier we used to use Sorting + Binary Search to find indexes, but now we use hashing.
4. Dynamic Programming
Dynamic programming (DP) is a technique for breaking down a complex problem into simpler subproblems. We solve the subproblems, remember their solutions and use them quickly solve a complex problems.
5. Exponentiation By Squaring
Exponentiation by squaring is a general method for computing large positive integer powers of a number in 0(log2N). Not only that but the method is also used to compute polynomial powers and square matrices.