Divide and conquer is an algorithm design paradigm in which a problem is divided into smaller subproblems (often two ones) of the same type and then each subproblem is solved independently. The division is applied recursively until sub-problems become simple enough to be solved directly using a base case. Finally, the solutions of all sub-problems are combined to get the solution for the original problem. Let’s…
Data structures
Let’s face it: there’s no way around algorithms if you’re hoping to write an innovative and efficient program. However, algorithms are not the only thing you need: besides the question of processing, there’s also the question of data storage. It’s best if it doesn’t take an awful lot of space, too. This is where data structures come in handy, so let’s learn the important basics…
The big O notation
The complexity of an algorithm Suppose you’d like to apply one of several algorithms to solve a problem. How to figure out which algorithm is better? You might implement these algorithms, start many times, and then analyze the time of solving the problem. However, this approach compares implementations rather than algorithms. There is no guarantee that the results will be the same on another computer.…
Computer algorithms
Everyday algorithms You have probably heard something about algorithms in real life. Simply, it is just a step-by-step sequence of actions that you need to do to achieve a useful result. It can be an algorithm for cooking a sandwich described by a recipe, or an algorithm for getting dressed according to today’s weather and your mood.