Algorithm for sharing (divide and conquer)
What is the Divide and Conquer algorithm?
Divide and Conquer (Divide and Conquer) is an important method of designing algorithms. The idea of this method is quite simple and easy to understand: When you need to solve a problem, we will proceed to divide that problem into smaller subproblems. Continue dividing until these small problems cannot be further divided, then we will solve these smallest problems and finally combine the solution of all small problems to find the solution of the lesson. original math.
In general, you can understand the Divide and Conquer algorithm through the following three processes:
Process 1: Split (Divide / Break)
In this step, we divide the original problem into subproblems. Each subproblem should be part of the original problem. In general, this step uses recursive methods to split problems until it cannot be further divided. Then, subproblems are called "atomic", but they still represent some part of the original problem.
Process 2: Solve the problem (Conquer / Solve)
In this step, subproblems are solved.
Process 3: Combining solutions (Merge / Combine)
After subproblems have been solved, in this step we will combine them recursively to find solutions to the original problem.
Limitations of the sharing algorithm (Devide and Conquer)
The algorithm to divide and conquer existed two limitations, that is:
How to divide the problem logically into subproblems, because if subproblems are solved with different algorithms, it will be very complicated.
How to combine the solutions of subproblems is done.
Example algorithm for division
Here are some algorithms built on the Divide and Conquer method:
Alignment algorithm (Merge Sort)
Quick Sort (Quick Sort)
Binary Search algorithm (Binary Search)
Multiplication matrix of Strassen
According to Tutorialspoint
Previous lesson: Greedy Algorithm (Greedy Algorithm)
Next lesson: Dynamic Programming (Dynamic Programming)
You should read it
- Quick Sort (Quick Sort)
- What is algorithm?
- Dynamic Programming (Dynamic Programming)
- Shell Sort in data structure and algorithm
- How does YouTube algorithm work?
- Explain the rule 30-30-30 when resetting the router
- 40/30/20/10 Rule: The most scientific time management method
- Panda 4.0 algorithm was updated by Google on May 20, 2014
May be interested
- EA remake Command & Conquer with 4K graphics, new multiplayer mechanism, will be released in June this yearfans of the command & conquer game have been waiting for this for a long time.
- Greedy Algorithm (Greedy Algorithm)greedy algorithm is a combination optimization algorithm. search algorithms, select local optimal solutions in each step in the hope of finding a global optimal solution.
- Introducing the greedy algorithmin this article, i will introduce a rather interesting algorithm called greedy algorithm and its detailed solution.
- Facebook is about to change the algorithm, articles that use 'interactive traps' will be downgradedfacebook is about to release an update to continue to downgrade posts using 'interactive traps' to attract people to comment, displaying less public content, including videos and other posts from publishers. edition or business.
- Toshiba's algorithm helps normal computers calculate faster than supercomputersnormal computers will optimize the combination much faster than supercomputers.
- Instagram is committed to adjusting the algorithm to limit the display of 'possibly harmful' content to usersinstagram has just made a commitment to adjust the algorithm to remove as much 'possibly harmful' content as possible on the platform and reach users.
- How to reset Instagram algorithm to get new feedthe following article will guide you how to reset the instagram algorithm and make your feed neat without too much effort.
- Future prospects when people own the solar systemthe film takes viewers on an exciting journey through the planets in the solar system: from a jump from the highest of the solar system to the glimpses of saturn's belt.
- Insert algorithm (Insertion Sort)sort insertion is a sorting algorithm based on in-place comparison. here, a sub-list is always maintained in sorted form. inserting is inserting an element into the sorted list of children. the element is inserted in the appropriate position so that the list is still in order.
- What determines what YouTube shows on your feed?these videos do not appear by accident; all related to the inner workings of the youtube algorithm.