Introduction to Basic algorithms

Source: Internet
Author: User

The basic algorithms are divided into the following four categories:

1 , substructure class algorithm: Divide and conquer algorithm, greedy method, dynamic programming

Substructure problem is mainly to know how to solve the problem from the solution of sub-structure problem, the most rough is simple recursion, on the basis of the recursive improvement on the formation of the division, greed and dynamic planning.

Dynamic programming essentially only reduces the iterative solution of sub-structural problems in the recursive process, but it does not reduce the solution space of substructure problems, so there are some problems that using dynamic programming usually do not minimize the time complexity, these problems often require more ingenious solution to achieve the optimal time complexity.

Divide-and-conquer law focuses on the middle

1, dynamic planning focus on the sub-structure from the beginning to consider

2, focus on the introduction of the existing structure from the sub-structure, the need to record sub-structure values

The greedy method focuses on the whole and finds the optimal

2 , search class algorithm: Backtracking method, Branch-bound method Depth-First search Breadth First Search

Search class algorithm The most coarse is the brute force enumeration, the backtracking method is based on the depth-first search, the branch-bound method is established on the basis of the breadth first (the branch bound maintains a priority queue, expands and calculates the priority value according to the breadth priority, then puts in the priority queue and selects the optimal point as the next extension point)

The search class algorithm mainly needs to be clear whether it can be ordered to the poor lifting solution space.

The Dijkstra algorithm is best attributed to the branch gauge, which expands each time the minimum path is selected from the queue

3 , sorting class algorithm:

bubbling, inserting, selecting

Hill, Merge, heap, quick row

Count, base, bucket

4, find the class algorithm:

Traverse Lookup, Binary lookup

Index lookups, hash tables

Introduction to Basic algorithms

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.