2014 soft test programmer-frequent test knowledge point review notes [Chapter 9]

Source: Internet
Author: User

51cto college specially sorted out "2014 soft test programmer-General test knowledge point review notes [summary]" in the soft test preparation season to help schools pass through smoothly! For more software proficiency test counseling and questions, please pay attention to the 51cto college-soft exam classification!


View summary:2014 soft test programmer-frequent test knowledge point review notes [summary]650) This. width = 650; "alt =" popular article "src =" http://www.exam8.com/images/hot.gif "style =" padding: 0px; margin: 0px; Vertical-align: middle; Border: 0px; "/>


  B, B-, B +, B *, red/Black, and trie

  (1) B tree: the binary search tree.

1. All non-leaf nodes have at most two sons (left and right );

2. Each node stores a keyword;

3. The left pointer of a non-leaf node points to the subtree smaller than its keyword, And the right Pointer Points to the subtree larger than its keyword;

For example:

B-tree search starts from the root node. If the query keyword is the same as the node keyword, it hits; otherwise, if the query keyword is smaller than the node keyword, it enters the left son; if it is larger than the node keyword, it enters the right son; If the left son or right son pointer is empty, the report cannot find the corresponding keyword;

If the number of left and right Subtrees of all non-leaf nodes of Tree B is almost (balanced), the search performance of Tree B approaches binary search; however, it has the advantage of Binary Search over the continuous memory space: Changing the B-tree structure (inserting and deleting nodes) does not need to move large segments of memory data, or even constant overhead;

For example:

However, after multiple inserts and deletions, Tree B may have different structures:

The right side is also a B-tree, but its search performance is linear. The same keyword set may lead to different tree indexes. Therefore, to use Tree B, we should also consider keeping the structure of the Left graph as much as possible, and avoiding the structure of the right graph, that is, the so-called "balance" problem;

The B-tree actually used is based on the original B-tree with a balanced algorithm, that is, the "balanced binary tree". The key to balancing a binary tree is how to maintain a balanced distribution of B-Tree nodes; the balancing algorithm is a strategy for inserting and deleting nodes in Tree B;

  (2) B-tree

It is a multi-path search tree (not a binary tree). Multiple-channel balanced search trees:

1. Define any non-leaf node with a maximum of M sons; and M> 2;

2. The number of sons at the root node is [2, m].

3. The number of non-leaf nodes except the root node is [m/2, m];

4. Each node holds at least m/2-1 (rounded up) and at most M-1 keywords; (at least 2 keywords)

5. Number of keywords for non-leaf nodes = number of pointers to Son-1;

6. Non-leaf node keywords: K [1], K [2],…, K [M-1]; and K [I] <K [I + 1];

7. Non-leaf node pointer: P [1], p [2],…, P [m]; where P [1] points to a subtree with a keyword less than K [1], p [m] points to a subtree with a keyword greater than K [M-1, other P [I] points to the subtree where the keyword belongs (K [I-1], K [I;

8. All leaf nodes are on the same layer;

Example: (M = 3)

B-tree search: starts from the root node and performs a binary search for the keyword (ordered) sequence in the node. If hit, the query ends. Otherwise, the son node in the search keyword range is entered; repeat until the corresponding son pointer is null or is already a leaf node;

B-Tree features:

1. The set of keywords is distributed in the entire tree;

2. Any keyword appears only in one node;

3. The search may end at a non-leaf node;

4. The search performance is equivalent to performing a binary search in the complete set of keywords;

5. Automatic hierarchical control;

Because the non-leaf nodes except root nodes are restricted, at least m/2 sons are contained, and the minimum utilization of nodes is ensured. The lowest search performance is as follows:

M indicates the maximum number of Subtrees for non-leaf nodes and N indicates the total number of keywords;

Therefore, the performance of B-tree is always equivalent to binary search (irrelevant to m value), so there is no B-tree balance problem;

Due to the limitation of M/2, if the node is full when inserting the knot, you need to split the knot into two nodes each occupying M/2. When deleting the knot, merge two sibling nodes with less than M/2;



Recommended high-quality articles:

Preparing for the 2014 soft exam! Recommendation of high-quality video tutorials (Comprehensive review + experience sharing + pre-test Sprint)

Knowledge points of Network Management in 2014 computer soft examination [summary]

Exercise questions and answers for the 2014 soft exam Network Administrator examination [summary]

2014 soft test programmer-test-exercise questions before the test [summary]


For online soft test video tutorials, click:

Http://edu.51cto.com/course/courseList/id-44.html



650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/3D/9F/wKioL1PE_n3z629yAACXIHScsJM092.jpg "alt =" wkiol1pe_n3z629yaacxihscsjm092.jpg "style =" padding: 0px; margin: 0px; Vertical-align: Top; Border: none; "/>


This article is from the "51cto college official blog" blog, please be sure to keep this source http://51edu.blog.51cto.com/8899635/1539402

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.