Common data structures and algorithms

Source: Internet
Author: User

Data

What is the use of research data structures?

data structures are the way computers store and organize data. A data structure is a collection of elements that have one or more specific relationships to each other. Typically, a well-chosen data structure can lead to higher operational or storage efficiency. Data structures are often associated with efficient retrieval algorithms and indexing techniques.

data structure specifically refers to the same class of data elements in the Span class= "Words-wrap-outer-cover" >,, logical structure of data , data storage structure and data operation structure Span class= "Words-wrap-outer-cover" >

    • Stack
    • Queue
    • Binary tree (full two fork tree, complete binary tree, sparse binary tree)
    • Tree
    • Hoffman, Huffman Code
    • Figure
    1. Storage representations of graphs (adjacency matrices, adjacency tables)
    2. Graph traversal, connectivity (depth-first search-corresponding stack Dfs, width-first search-corresponding queue BFS)
    • Minimum spanning tree
    • 1. Kruskal algorithm (to add a minimum weight to the graph, and two adjacency points in different connected components that do not form the side of the loop)

      2. Prim algorithm (from a vertex, select the edge with its associated minimum weight, add another vertex to the collection U, each subsequent step from one vertex in U, the other not in the edge of U to select the least weight of the edge, the vertex is not in u to join U, until all the vertices are in u)

    1. Shortest path problem
    • 1. Dijkstra algorithm (no negative weighted edges in the graph)

      2. Bellman-ford algorithm (no negative weight path in figure

    • Active Network (AOV (topological sorting problem), AOE (critical path problem))

Algorithm

What can be called an algorithm?

The algorithm can be understood as a complete problem-solving step which consists of basic operation and specified sequence of operations. Or as a finite, precise sequence of calculations that is designed as required, and such steps and sequences can solve a class of problems

Characteristics: Poor precision input and output feasible

    • A common sorting algorithm
    1. Bubble sort
    2. Select sort
    3. Merge sort
    4. Quick Sort
    5. Heap Sort
    6. Insert Sort
    7. Hill sort

Sorting Algorithms related blogs: http://blog.jobbole.com/11745/

    • Common lookup algorithms
    1. Order lookup
    2. Binary lookup (recursive implementation, non-recursive implementation)
    3. block find
    4. binary tree lookup

Frontline Lookup
Also called sequential lookup, it is searched from the first element of the array until it finds the location of the element to find until the result is found.
The best time is 1, the first is the long shot to be looked for, the worst look is O (n), and the last is the element to be found.

20 percent semi-search
Binary find is to look for the array elements are divided into two parts, each elimination of one-second, but there is a major premise is that the elements must be ordered, if the order is unordered, and then to sort operations, the search method, similar to the English Dictionary of Java, we can find the letter J, and then carefully find.
The best situation time is 1, that is, the first time to separate the search found, the worst lookup status is O (n), is the data to be found in the last time.

Tri-Interpolation Lookup
Interpolation lookup is a search method similar to binary lookup, where the interpolation lookup is the concept of a scale, finding the possible location of the data to be looked up, and then comparing it, if the value is smaller than what is being looked for, it means that the value to be looked for may appear in the range before the value, thus narrowing the scope to determine the final goal.

42 Fork Find Tree
A binary lookup tree is a spanning tree that treats the found data first, making sure that the value of the left branch of the tree is less than the value of the right branch, and then compares the size of the row and the parent node of each node to find the most appropriate range.

This algorithm is very efficient to find, but if you use this lookup method, you first create the tree.

Find algorithms related blogs: http://www.open-open.com/solution/view/1410494404789

    • of common

Common data structures and 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.