Articles on Trending Technologies

Technical articles with clear explanations and examples

Removing the Min Element from Interval Heaps

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 497 Views

In an interval heap, the smallest element is the element on the left hand side of the root node. This element is eliminated and returned.For filling the vacancy created on the left hand side of the root node, an element from the last node is eliminated and again inserted into the root node.This element is next compared successively with all the left hand elements of the descending nodes and the process terminates when all the conditions for an interval heap are met.In case if the left hand side element in the node becomes higher than the right side element at ...

Read More

Inserting an Element in Interval Heaps

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 325 Views

Depending on the number of elements which are present in the interval heap, following cases are possible -Odd number of elements: If the number of elements in the interval heap be odd, the new element is inserted in the last node at first. Then, it is compared with the previous node elements successively and tested to meet the criteria essential for an interval heap. In case if the element does not meet any of the criteria, it is transferred from the last node to the root until all the conditions are met.Even number of elements: If the number of elements ...

Read More

Double Ended Priority Queue (DEPQ)

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 2K+ Views

A double-ended priority queue (DEPQ) or double-ended heap is defined as a data structure like a priority queue or heap, but permits for efficient removal of both the maximum and minimum, according to some ordering on the keys or items stored in the structure. Every element in a DEPQ associated with a priority or value. In a DEPQ, it is possible to eliminate or remove the elements in both ascending and descending order.OperationsA double-ended priority queue consists of the following operationsisEmpty()This function is responsible to check if DEPQ is empty and returns true if empty.size()This function is responsible to return the total ...

Read More

Soft Heaps

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 579 Views

A soft heap is defined as a variation on the simple heap data structure that consists of constant amortized time for 5 types of operations. This is obtained by carefully "corrupting" (increasing) the keys of maximum a certain number of values in the heap. The constant time operations are −create(s) − Create a new soft heap sinsert(s,  y) − Insert an element y into a soft heap smeld(s,  s' )of two soft heaps s and s′ into one, destroying bothdelete(s,  y) − Delete an element y from a soft heap sfindmin(s) − Get the element with least key in the soft ...

Read More

Adaptive Properties of Pairing Heaps

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 206 Views

Pairing heaps are implemented for a perfect use of a priority queue. A priority queue maintains track of the minimum of a set of objects, so every time we take something eliminate from the queue it is always the minimum value. Priority queues are mostly implemented when using Dijkstra’s Algorithm to calculate the shortest path in a graph.Pairing heaps are perfect because they are easy to use and operate well in real applications. Specifically, they operate excellent in amortized time . Meaning that while an individual operation consumes a longer time, the sum of all the operations over the whole ...

Read More

Amortized Cost of Meld Operation

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 396 Views

Calculating the amortized cost of meld operation is a difficult task. The major difficulty is in accumulating for the wide variations in the costs of an operation performed at different points in a random sequence of operations. Although our design goal is affected by the costs of sequence of operations, defining the notion of amortized cost of an operation in terms of the costs of sequences of operations leads nothing. Implementing a potential function to off set the variations in the actual costs is a perfect way of handling the situation.In the next topic we discuss the notion of amortized ...

Read More

Pairing Heaps

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 1K+ Views

A pairing heap is defined as a type of heap data structure with relatively easy implementation and superb practical amortized performance.Pairing heaps are heap-ordered multiway tree structures, and can be denoted as simplified Fibonacci heaps.They are considered a "robust choice" for implementing such Algorithms like Prim's MST Algorithm, and support the following operations (assuming a min-heap) −find-min − This function is responsible to return the top element of the heap.meld −This function is responsible to compare the two root elements, the smaller remains the root of the result, the larger element and its subtree is added as a child of ...

Read More

Connectivity, Distance, and Spanning Trees

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 818 Views

Spanning TreeOne simple definition is that a tree is a connected graph associated with no cycles, where a cycle let's us go from a node to itself without repeating an edge.A spanning tree for a connected graph G is defined as a tree containing all the vertices of G.Spanning trees are often implemented for Internet routing Algorithms. In the Internet, computers (nodes) are often connected with many redundant physical connections.Total number of Spanning Trees in a Graph. If a graph is a complete graph with n no. of vertices, then total number of spanning trees is n(n-2)where n is denoted ...

Read More

m-ary tree

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 3K+ Views

An m-ary tree in computer science is defined as a collection of nodes normally represented hierarchically in the following manner.The tree is started at the root node.Each node of the tree maintains a list of pointers to its child nodes.The number of child nodes is less than or equal to m.A typical representation of m-ary tree implements an array of m references (or pointers) to store children (Note that m is an upper bound on number of children).An m-way search treea. is empty orb. consists of a root containing b (1

Read More

Potential Method

Arnab Chakraborty
Arnab Chakraborty
Updated on 02-Jan-2020 2K+ Views

According to computational complexity theory, the potential method is defined as a method implemented to analyze the amortized time and space complexity of a data structure, a measure of its performance over sequences of operations that eliminates the cost of infrequent but expensive operations.In the potential method, a function Φ is selected that converts states of the data structure to non-negative numbers. If S is treated as state of the data structure, Φ(S) denotes work that has been accounted in the amortized analysis but not yet performed. Thus, Φ(S) may be imagined as calculating the amount of potential energy stored ...

Read More
Showing 55781–55790 of 61,297 articles
Advertisements