Found 510 Articles for Algorithms

Inserting an Element in Interval Heaps

Arnab Chakraborty
Updated on 02-Jan-2020 07:54:12

132 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

Symmetric Min-Max Heaps

Arnab Chakraborty
Updated on 13-Jul-2020 07:15:03

927 Views

A symmetric min-max heap (SMMH) is defined as a complete binary tree in which each node except the root has exactly one element. The root of an SMMH be empty and the total number of nodes in the SMMH is m + 1, where m is the number of elements.Let y be any node of the SMMH. Let elements(y) be the elements in the sub tree rooted at y but excluding the element (if any) in y. Assume that elements(y) j= ∅. y satisfies the following properties:The left child of y has the minimum element in elements(y).The right child of ... Read More

Double Ended Priority Queue (DEPQ)

Arnab Chakraborty
Updated on 02-Jan-2020 07:49:18

1K+ 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
Updated on 02-Jan-2020 07:26:18

319 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
Updated on 02-Jan-2020 07:10:45

94 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
Updated on 02-Jan-2020 07:05:43

228 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

Variations of Pairing Heaps

Arnab Chakraborty
Updated on 02-Jan-2020 07:02:14

118 Views

A pairing heap can be either an empty heap, or a pairing tree containing of a root element and a possibly empty list of pairing trees.The heap ordering property needs that parent of any node is no greater than the node itself.The following description considers a purely functional heap that does not support the decrease-key operation.type PairingTree[Element] = Heap(element: Element, subheaps: List[PairingTree[Element]])type PairingHeap[Element] = Empty | PairingTree[Element]Pairing heaps exist in two varieties--min pairing heaps and max pairing heaps. Min pairing heaps are implemented when we wish to represent a min priority queue, and max pairing heaps are implemented for max ... Read More

Pairing Heaps

Arnab Chakraborty
Updated on 02-Jan-2020 06:59:56

598 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

Meldable Priority Queues and Skew Heaps

Arnab Chakraborty
Updated on 02-Jan-2020 06:57:05

502 Views

Meldable Priority QueuesDefinitionA randomized meldable heap (also Meldable Heap or Randomized Meldable Priority Queue) is defined as a priority queue based data structure in which the underlying structure is also a heap-ordered binary tree. However, there are no hard and fast rules on the shape of the underlying binary tree.AdvantagesThis approach has a number of facilities i.e. advantages over similar data structures.It offers simpler approach than other data structures.All operations for the randomized meldable heap are easy to apply and the constant factors in their complexity bounds are small.There is also no requirement to preserve balance conditions and no satellite ... Read More

Connectivity, Distance, and Spanning Trees

Arnab Chakraborty
Updated on 02-Jan-2020 06:54:08

387 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

Advertisements