Brief title (data structure)

Brief title

Data Structure focuses on the "Data" or "structure"
focuses on the structure. Programming data structure is a problem in the study of non-numerical operation target computer (i.e., data elements), and the relationship between the subject and the operation between them. How rational organization and efficient processing of data is a major research question data structure.

Structural adhesive linear form of storage sequence table, the chain storage structure called a linear list table, briefly you please "random access sequence table stored sequentially; random access lists are sequentially read" Understanding this sentence

Sequence table storage location is a continuous area, random access can be performed according to the following standard, and scattered in various places in the list storage area, connected by a pointer, want to read a data, it is necessary to continue through the pointer from the rearward Look for

Data structure you are familiar with those data types are defined recursively? Give a recursive definition of the data type, and a brief explanation
a single linked list data structure is a recursive

typedef struct LNode
{
	ElemType data;
	struct LNode *next;
}LinkList;

What are the similarities and differences stacks and queues with ordinary linear table?
The same point: There is one to one relationship between the data elements, storage, and the same linear form
different: the stack is defined to make the insertion or deletion in the footer, is LIFO; insertion queue is defined at one end, at the other end delete, is FIFO

Based on the keyword comparison sorting algorithm can achieve optimal time complexity? You can design an algorithm that does not require comparison between keywords? Give basic idea of
O (n); radix sorting; keywords are sorted based on size, distribution and collection by means of two operations on a single logical sort keywords

Description of how to improve the algorithm KMP string pattern matching efficiency
whenever a match occurs trip unequal character comparison, the results do not need to go back "partial match" has been using two pointers will want to slide as far as the pattern period continue to compare the distance

Give basic structure of four data types
set, linear structure, a tree structure, and a mesh structure-like structure in FIG.

DESCRIPTION stacks and queues distinction
stack allowing only one end of the table will be insert or delete operation
queue only allowed at one end is inserted into the table, deleting at the other end

What is the critical path
in the AOE network, some activities can be run in parallel, the shortest completion time should be the longest path from source to sink point (refers to the value of the path and ownership), said that such a path is a critical path

Insertion sort, which has several categories? Which of these is unstable sort
insertion sort into direct insertion sort, binary insertion sort, Hill
where Shell sort is unstable sorting algorithm

Data structures
presence of one or more data elements of the particular relationship between each set of the data structure of formula

What is a stable sort method
stable sort method: if your keywords Ki = Kj, and in sequence before ordering, Ki ahead Kj, if still ahead after ordering Ki Kj, the sorting method called stable
stable sort: bubble, direct insertion, merge, radix
unstable sort: the rapid, Hill, heap
uncertain Sort: simple selection sort (insert version stable and unstable exchange version)

Binary sort tree
binary sort tree, also known as a binary search tree, a binary sort tree is empty tree or a non-empty with the following characteristics binary tree:
1, if the left subtree is not empty, then the left subtree all nodes root key values are less than the key value
2, if the right subtree is not empty, all the right subtree of node key values are greater than the root key value
3, two left and right subtrees itself binary sort tree

Description of the difference between the three concepts: the head pointer, the head node, the node header
head pointer: is a pointer to a linked list pointer to the first node
the first node: a node before the node attached to the first element, its pointer field points to the first element node
header node: the first element is also called node, the node list is stored in the first data element

What is the recursive procedure? Advantages and disadvantages of recursive procedure? Recursive program is executed, what kind of data structure should help to complete?
Recursive procedure: If a function or process data structure definitions apply his own, then this function or process data structure called a recursive definition, referred to as a recursive
advantages: put a large complex problems into smaller scale of a problem to solve, greatly reduces the amount of code of the program, so that description of the problem and solution becomes clear and simple design algorithm more

Brief circular queue data structure, and write the initial state, the value of the empty queue, the queue is full when the head of the queue pointer queue tail pointer field

typedef stract{
	ElemType *elem;
	int front,rear;
	}SqQueue Q;

Initial state: Q.front = Q.rear = 0
queue empty: Q.front = Q.rear
queue full: Q.front = (Q.rear + 1) % MAXSIZE

About sorting algorithm complexity and stability of the
Here Insert Picture Description
string, array, generalized table from the point of view the relationship between elements can be seen as a linear structure, the special nature of what they are compared with the linear form of the general sense of
the string is limited from zero to more characters sequence. From the data structure point of view, it belongs to the series of linear structure, with the particularity that the linear form of the element is a character string of
an array similar to linear table is constructed from the same type of data element from each element of the array by a value and a decision group index, the relationship between the array elements reflected by the subscript
generalized nonlinear table is a data structure that is an extension of the linear form, i.e., the generalized table to relax restrictions on the atomic elements, allowing they have their own structure

With stacks can achieve more complex operations, please briefly how to use the stack to achieve expression in parentheses match inspection
from left to right scanning expressions, found that "(" found on the stack ")" on the stack, if not "(" not matched, the last scanned if the stack is empty match

Figure breadth-first traversal of the tree traversal similar to what? Give a simple explanation
diagram of breadth-first traversal and tree traversal similar levels, both of which are accessible from that point to all other neighboring nodes, the tree is to look at its left and right subtrees connection, connectivity point is to look at Fig.

The data structure is often used "tree organization" way of organizing data, such as binary search table, binary sort tree, the top of the heap large / small pile top, etc. Please describe briefly the advantages of doing so
with a tree structure so that the data can be storage and searching more convenient, can greatly improve the efficiency during search, and can represent relationships between data

What is the overflow of the queue? What solution
at sequential storage structure queue, queue head pointer is provided Front, the tail pointer is REAR, MaxNum capacity queue is, when there is a queue element to be added, if rear = maxnum, occurs on the queue overflow, then we can not talk about that element into the team. For queues, there is a false overflow phenomenon, there is enough space in the queue, but not the element into the team, usually caused by improper selection of the queue storage structure or mode of operation, can be used to solve the circular queue.
Overflow on the solution: build a large enough storage space

Storage structure for both sex lines, if the total number of linear form stable and rarely insertions and deletions, but requires the fastest access to elements in a linear list, which storage structure should be used?
Sequential storage structure should be selected, since the starting position of the storage location of each data element and a constant phase difference is proportional to the linear form of a table and data elements in the linear number. As long as the start position thus determined, a data element in any table can be linear random access, thus, the order table storage structure is a linear random-access data structure, a linked list is a sequential access memory structure

Set in the round robin tail pointer over the list to set the head pointer okay? Why
is provided a tail pointer setting better than the head pointer, a tail pointer points to termination node pointer, which is represented by a single cycle may cause the list to find the start node and end node of the linked list and convenient

Binary special conditions

  • In sequence preorder =: empty tree or any left child node no non-null binary
  • = The subsequent sequence: or any empty tree node no right child of the non-null binary
  • After the first order = order: an empty tree node or only a binary tree
Published 73 original articles · won praise 20 · views 4473

Guess you like

Origin blog.csdn.net/lzl980111/article/details/103018130