Found 218 Articles for Analysis of Algorithms

B+ tree Query in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:35:34
Here we will see, how to perform the searching in B+ Tree. The B+ Tree searching is also known as B+ Tree Querying. This algorithm is very much similar to the querying of B-Tree. Moreover, this supports range query. Suppose we have a B+ tree like below −Example of B+ Tree −The searching technique is very similar to the binary search tree. Suppose we want to search 63 from the above tree. So we will start from root, now 63 is larger than root element 60 but smaller than 75. So we will move to the right child of the ... Read More

The B+ tree in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:33:12
Here we will see what are the B+ Trees. The B+ Trees are extended version of B-Trees. This tree supports better insertion, deletion and searching over B-Tree.B-trees, the keys and the record values are stored in the internal as well as leaf nodes. In B+ tree records, can be stored at the leaf node, internal nodes will store the key values only. The leaf nodes of the B+ trees are also linked like linked listExample of B+ Tree −This supports basic operations like searching, insertion, deletion. In each node, the item will be sorted. The element at position i has ... Read More

B-tree Deletion in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:31:37
Here we will see, how to perform the deletion of a node from B-Tree. Suppose we have a BTree like below −Example of B-Tree −Deletion has two parts. At first we have to find the element. That strategy is like the querying. Now for deletion, we have to care about some rules. One node must have at-least m/2 elements. So if we delete, one element, and it has less than m-1 elements remaining, then it will adjust itself. If the entire node is deleted, then its children will be merged, and if their size issame as m, then split them ... Read More

B-tree Insertion in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:25:53
Here we will see, how to perform the insertion into a B-Tree. Suppose we have a B-Tree like below −Example of B-Tree −To insert an element, the idea is very similar to the BST, but we have to follow some rules. Each node has m children, and m-1 elements. If we insert an element into one node, there are two situations. If the node has elements less than m-1, then the new element will be inserted directly into the node. If it has m-1 elements, then by taking all elements, and the element which will be inserted, then take the ... Read More

B-tree Query in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:27:13
Here we will see, how to perform the searching in B-Tree. The B-Tree searching is also known as B-Tree Querying. Suppose we have a B-tree like below −Example of B-Tree −The searching technique is very similar to the binary search tree. Suppose we want to search 66 from the above tree. So we will start from root, now 66 is larger than root element 46. So we will move to the right child of the root. Then the right child has more than one element. The elements are sorted, they are [56, 81]. Our target key is larger than 56, ... Read More

Interval Heaps in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:19:04
Here we will see what is the interval heaps. The interval heaps are complete binary tree, in which, each node except possibly the last one contains two elements. Let the priorities of two elements in node P are ‘a’ and ‘b’. Here we are considering a ≤ b. We say that the node P represents the closed interval [a, b]. Here a is the left endpoint of the interval of P, and b is the right endpoint. The [c, d] is contained in the interval [a, b] if and only if a ≤ c ≤ d ≤ b. In an ... Read More

Max WBLT Operations in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:18:05
Here we will see what are the different Max-WBLT operations. The HBLT has different operations like insert, delete, and initializations. They are quite similar to the WBLT also. However, the meld operation can be done in a single top-to-bottom pass.A single pass meld operation is possible for WBLT. Because we can find the w values, on the way down. We can update the w values and swap subtrees as necessary. For HBLT, we cannot find the s values on the way down to the tree.As the meld can be done in a single top-to-bottom pass, then the insert and delete ... Read More

Weight-Biased Leftist Trees in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:15:01
Here we will see another variation of Leftist Tree. Here we will consider the number of nodes in a subtree, rather than the length of a shortest path for root to external node. Here we will define the weight w(x) of node x, to be the number of internal nodes in the subtree with root x. If x is an external node, then the weight is 0. If x is internal node, then the weight is one more than the sum of weights of its children.Here is an example of Weight Biased Leftist Tree (WBLT) −Suppose the Binary tree is ... Read More

Deletion of Arbitrary Element from a Max HBLT in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:13:14
Deleting Arbitrary nodes from Max or Min HBLT is not standard operation. for Priority queue or HBLT. If we want to delete a node say K from HBLT, we have to follow following rules.Detach the subtree rooted at K, from the tree, and replace it with the meld of the subtrees of node K.Update s values from the path from K to the root, and swap subtrees on this path as necessary to maintain the property of HBLT.To update the s value from K to root, we need the parent pointer for each node. This operation for updating the s ... Read More

Multiple Lists in a Single Array in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 07:11:51
Array representation is basically wasteful of space when it is storing data that will change over time. To store some data, we allocate some space which is large enough to store multiple values in an array. Suppose we use the array doubling criteria to increase the size of the array.Consider the current array size is 8192. This is full. So we need to increase it by using array doubling technique. So new array size will be 16384. Then copy 8192 elements from old array to new array, then deallocate the old array. Now we can realize that before deallocating the ... Read More
Advertisements