Advanced Data Structures by Peter Brass

By Peter Brass

Advanced information constructions offers a accomplished examine the information, research, and implementation info of knowledge constructions as a really good subject in utilized algorithms. info constructions are how info is saved inside of a working laptop or computer, and the way you can actually pass approximately looking for information inside of. this article examines effective how one can seek and replace units of numbers, periods, or strings via numerous information buildings, akin to seek bushes, constructions for units of durations or piece-wise consistent capabilities, orthogonal diversity seek buildings, lots, union-find constructions, dynamization and patience of buildings, constructions for strings, and hash tables. this is often the 1st quantity to teach information buildings as a vital algorithmic subject, instead of relegating them as trivial fabric used to demonstrate object-oriented programming method, filling a void within the ever-increasing desktop technological know-how industry. a number of code examples in C and greater than 500 references make complex info buildings an fundamental textual content. subject. a number of code examples in C and greater than 500 references make complex facts buildings an necessary text.
Alt. ISBN:0521880378, 0521880378, 9780521880374

Show description

Read Online or Download Advanced Data Structures PDF

Best computers books

Computer Vision – ACCV 2007: 8th Asian Conference on Computer Vision, Tokyo, Japan, November 18-22, 2007, Proceedings, Part II

The 2 quantity set LNCS 4843 and LNCS 4844 constitutes the refereed lawsuits of the eighth Asian convention on desktop imaginative and prescient, ACCV 2007, held in Tokyo, Japan, in November 2007. The forty six revised complete papers, three planary and invited talks, and a hundred thirty revised poster papers of the 2 volumes have been conscientiously reviewed and seleceted from 551 submissions.

Additional info for Advanced Data Structures

Example text

If root->left = NULL and root->right = NULL, then root->right and root->left point to the roots of the right and left subtrees. For each node *left node in the left subtree, we have left node->key < root->key, and for each node *right node in the right subtree, we have right node->key ≥ root->key. Any structure with these properties is a correct search tree for the objects and key values in the leaves. With these conventions we can now create an empty tree. 2 General Properties and Transformations In a correct search tree, we can associate each tree node with an interval, the interval of possible key values that can be reached through this node.

But we need to explain how to maintain this property of height balancedness under insert and delete operations. For this, we need to keep an additional information in each interior node of the search tree – the height of the subtree below that node. So the structure of a node is as follows: typedef struct tr_n_t { key_t key; struct tr_n_t *left; struct tr_n_t *right; int height; /* possibly other information */ } tree_node_t; The height of a node *n is defined recursively by the following rules: { if *n is a leaf (n->left = NULL), then n->height = 0, { else n->height is one larger than the maximum of the height of the left and right subtrees: n->height = 1 + max(n->left->height, n->right->height).

The following code does a left rotation around *n: void left_rotation(tree_node_t *n) { tree_node_t *tmp_node; key_t tmp_key; tmp_node = n->left; tmp_key = n->key; n->left = n->right; 28 2 Search Trees n->key = n->right->key; n->right = n->left->right; n->left->right = n->left->left; n->left->left = tmp_node; n->left->key = tmp_key; } Note that we move the content of the nodes around, but the node *n still needs to be the root of the subtree because there are pointers from higher levels in the tree that point to *n.

Download PDF sample

Rated 4.09 of 5 – based on 11 votes