Found 210 Articles for Analysis of Algorithms

Merge Algorithms in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 06:24:45

581 Views

The Merge algorithm is used to merge two sorted list into one list. This algorithm is used in different cases. If we want to perform merge sort, then we need to merge the sorter lists into larger lists.The approach is simple. We take two lists, there will be two pointers. The first one will point to the element of the fist list, second one will point to the elements of the second list. Based on their values, the smaller element is taken from one of these two lists, then increase the pointer of that corresponding list. This operation will be ... Read More

Binary Trees as Dictionaries in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 06:21:18

811 Views

When we try to implement abstract data type Dictionary, then the node associates with values. A dictionary is basically a set of keys, which must be elements drawn from a total ordering. There may be additional information, which are associated with each key, but it does not lead to any conceptual comprehension.If the dictionary is implemented using trees, then each node will hold unique keys. Here for each node u in the tree, every key is u.l is strictly smaller than u.k. And every key in u.r, is strictly larger than u.k. A tree is organized according to this invariant ... Read More

Robin-Hood Hashing in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 06:20:11

260 Views

In this section we will see what is Robin-Hood Hashing scheme. This hashing is one of the technique of open addressing. This attempts to equalize the searching time of element by using the fairer collision resolution strategy. While we are trying to insert, if we want to insert element x at position xi, and there is already an element y is placed at yj = xi, then the younger of two elements must move on. So if i ≤ j, then we will try to insert x at position xi+1, xi+2 and so on. Otherwise we will store x at ... Read More

LCFS Hashing in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 06:18:32

389 Views

In this section we will see what is LCFS Hashing. This is one of the open-addressing strategy, that changes the collision resolution strategy. If we check the algorithms for the hashing in open address scheme, we can find that if two elements collide, then whose priority is higher, will be inserted into the table, and subsequent element must move on. So we can tell that the hashing in open addressing scheme is FCFS criteria.With the LCFS (Last Come First Serve) scheme. The task is performed exactly in opposite way. When we insert one element, that will be placed at position ... Read More

Asymmetric Hashing in Data Structure

Arnab Chakraborty
Updated on 11-Aug-2020 06:18:11

192 Views

In this section we will see what is Asymmetric Hashing technique. In this technique, the hash table is split into d number of blocks. Each split is of length n/d. The probe value xi, 0 ≤ i ≤ d, is drawn uniformly from $$\lbrace\frac{i*n}{d}, ..., \frac{(i+1)*n}{d-1}\rbrace$$. As with multiple choice hashing, to insert x, the algorithm checks the length of the list A[x0], A[x1], . . ., A[xd – 1]. Then appends x to the shortest of these lists. If there is a tie, then it inserts x to the list with smallest index.According to Vocking, the expected length of ... Read More

Balanced binary search trees in Data Structure

Arnab Chakraborty
Updated on 10-Aug-2020 09:38:24

698 Views

Here we will see what is the balanced binary search tree. The binary search trees (BST) are binary trees, who has lesser element at left child, and greater element at right child.The average time complexity for searching elements in BST is O(log n). It is depending on the height of the binary search tree. To maintain the properties of the binary search tree, sometimes the tree becomes skewed. So the skewed tree will be look like this −This is actually a tree, but this is looking like a linked list. For this kind of trees, the searching time will be ... Read More

Brent’s Method in Data Structure

Arnab Chakraborty
Updated on 10-Aug-2020 09:36:38

471 Views

In this section we will see what is Brent’s Method related to open addressed hashing. This method is a heuristic. This attempts to minimize the average time for a successful search in a hash table.This method was originally applying on double hashing technique, but this can be used on any open addressing techniques like linear and quadratic probing. The age of an element x, is stored in an open addressing hash table, is the minimum value i, such that x is placed at A[xi]Brent’s Method tries to minimize the total age of all elements. If we insert an element x, ... Read More

Double Hashing in Data Structure

Arnab Chakraborty
Updated on 10-Aug-2020 09:34:18

3K+ Views

In this section we will see what is Double Hashing technique in open addressing scheme. There is an ordinary hash function h´(x) : U → {0, 1, . . ., m – 1}. In open addressing scheme, the actual hash function h(x) is taking the ordinary hash function h’(x) when the space is not empty, then perform another hash function to get some space to insert.$$h_{1}(x)=x\:mod\:m$$$$h_{2}(x)=x\:mod\:m^{\prime}$$$$h(x, i)=(h^{1}(x)+ih^{2})\:mod\:m$$The value of i = 0, 1, . . ., m – 1. So we start from i = 0, and increase this until we get one free space. So initially when i = ... Read More

Quadratic Probing in Data Structure

Arnab Chakraborty
Updated on 10-Aug-2020 09:32:46

6K+ Views

In this section we will see what is quadratic probing technique in open addressing scheme. There is an ordinary hash function h’(x) : U → {0, 1, . . ., m – 1}. In open addressing scheme, the actual hash function h(x) is taking the ordinary hash function h’(x) and attach some another part with it to make one quadratic equation.h´ = (𝑥) = 𝑥 𝑚𝑜𝑑 𝑚ℎ(𝑥, 𝑖) = (ℎ´(𝑥) + 𝑖2)𝑚𝑜𝑑 𝑚We can put some other quadratic equations also using some constantsThe value of i = 0, 1, . . ., m – 1. So we start from i ... Read More

Linear Probing in Data Structure

Arnab Chakraborty
Updated on 10-Aug-2020 09:30:50

7K+ Views

In this section we will see what is linear probing technique in open addressing scheme. There is an ordinary hash function h´(x) : U → {0, 1, . . ., m – 1}. In open addressing scheme, the actual hash function h(x) is taking the ordinary hash function h’(x) and attach some another part with it to make one linear equation.h´(𝑥) = 𝑥 𝑚𝑜𝑑 𝑚ℎ(𝑥, 𝑖) = (ℎ´(𝑥) + 𝑖)𝑚𝑜𝑑 𝑚The value of i| = 0, 1, . . ., m – 1. So we start from i = 0, and increase this until we get one freespace. So initially ... Read More

Previous 1 ... 3 4 5 6 7 ... 21 Next
Advertisements