

Pattern matching/searching is one of the most important problem in Computer Science. RSA also uses modular arithmetic along with binary exponentiation. Calculation of large powers of a number is mostly required in RSA encryption.Not only this, the method is also used for computation of powers of polynomials and square matrices. What if I told you it can be done in 5 iterations?Įxponentiation by squaring or Binary exponentiation is a general method for fast computation of large positive integer powers of a number in O(log 2N). Normally we’d iterate 32 times and find the result. There are many DP algorithms and applications but I’d name one and blow you away, Duckworth-Lewis method in cricket.So you didn’t need to recount because you remembered there were eight! Dynamic Programming is just a fancy way to say ‘remembering stuff to save time later’ *writes down another “1+” on the left* What about that? *writes down “1+1+1+1+1+1+1+1 =” on a sheet of paper* What’s that equal to? We solve the subproblems, remember their results and using them we make our way to solve the complex problem, quickly. We can also use Set data structure for this operation.ĭynamic programming (DP) is a method for solving a complex problem by breaking it down into simpler subproblems. To perform the check if a value already exists in a list.In routers, to store IP address -> Path pair for routing mechanisms.Choosing a good hash function depends upon the scenario. Idea is to use an appropriate hash function which does the key -> value mapping. The data structure is referred as Hash-Map or Hash-Table or Dictionary that maps keys to values, efficiently. Previously we relied on Sorting+Binary Search to look for index whereas now we use hashing. Hash lookup is currently the most widely used technique to find appropriate data by key or ID. Finding shortest path between two cities in a map and many other such applications.Used in artificial intelligence to build bots, for instance a chess bot.


This list is prepared keeping in mind their use in competitive programming and current development practices. Today, We will see what they do and where they are used with simplest examples.

In programmers life algorithms and data structures is most important subject if they want to go out in the programming world and make some bucks.
