Sort of knowledge base data structure

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/zhanshen112/article/details/100129891

1, a data structure of action

Data structure may actually be understood as a data storage structure in a computer and use of. If the container by means of the concept of C ++, data structures can be thought of as a particular layout container to store data.
This "layout" determines the data structure is efficient for certain operations, while other operations are inefficient. First, we need to understand the various data structures, in order to select the most appropriate data structure in dealing with practical problems. Different data structures suitable for different application scenarios.

2, common data structures

Current general-purpose computer professional teaching of "data structure" as professional courses, the main contents of the data structure is:

  • Array
  • List (list single / double-linked / circular linked list)
  • Stack
  • queue
  • Tree (binary / red-black tree)
  • Map
  • Trie (which is an efficient tree structure, but worthy of note alone)
  • Hash table (hash table)

3, the array

Array is any programming language will be talking about data structures, it is the most simple data structure.

We can be divided into the overall data data storage data storage a single variable and large amounts of data. Variable single data storage in general is determined by the variable type, such as int occupies 4 bytes, char 1-byte and the like. A large amount of data storage is the main data structure, and is a particular way of storing data.

Arrays are the simplest and most widely used data structures. Other data structures, stacks, queues, etc. by an array evolved.

Each data element is associated with a positive value, which we call the index, which indicates the position of each element in the array is located. Most languages ​​define initial index will be zero.

4, the stack

The characteristics of the stack is the last in first out, queue just to control study. A linear stacks and queues data structure elements are sequentially stored. That is learn stacks, queues will learn.

5, queue

The characteristics of the stack is the first in first out, with stacks just to control study. A linear stacks and queues data structure elements are sequentially stored. That is, learn to queue, stack it learned.

6, the list

Linear list data structure is also important, as a linked list chain of nodes, where each node contains pointers pointing to data and subsequent nodes. Further comprising a list head pointer to the first element of the list, but the list is empty, or null point it is no specific content.

List generally used to implement the file system, the hash table and adjacency table.

7, tree

The tree structure is a hierarchical data structure. FIG similar tree, but the tree and important features distinguishing the loop does not exist in the tree.

8, FIG.

FIG is a set of nodes in the network form interconnected. Also referred to as a vertex node. A pair of nodes (x, y) is called the edge (edge), is connected to the vertex of vertices x y. Edges may comprise a weight / cost, show x from the apex to the cost of y.
The graph type

  • Undirected graph
  • Directed graph

In the programming language, may be represented by FIG two forms:

  • Adjacency matrix
  • Adjacency list

Common graph traversal algorithm

  • BFS
  • Depth-first search

9, trie (trie)

Dictionary tree, also known as "prefix tree", is a special kind of tree data structure is very effective for solving problems related to the string. It provides quick retrieval, searching mainly for word in the dictionary, automatically providing advice in the search engines, even for IP routing.
Trie

10, hash table

A hash table is used to process each object uniquely identifies the object and the unique index number stored in the pre-calculated. Thus, objects are stored in the form of key-value pairs, which value pairs set to be called a dictionary. You can use search for objects like keys, there are many different hash-based data structures, but the most common is a hash table.

Hash table is typically implemented as an array.

Performance hash data structure depends on the following factors:

  • Hash function
  • The size of the hash table
  • Collision processing method

Guess you like

Origin blog.csdn.net/zhanshen112/article/details/100129891