Package org.drip.graph.softheap
Class KaplanZwickTree<KEY extends java.lang.Comparable<KEY>,ITEM>
java.lang.Object
org.drip.graph.softheap.KaplanZwickTree<KEY,ITEM>
public class KaplanZwickTree<KEY extends java.lang.Comparable<KEY>,ITEM>
extends java.lang.Object
KaplanZwickTree implements the Tree described in Kaplan and Zwick (2009). The References are:
- Chazelle, B. (2000): The Discrepancy Method: Randomness and Complexity https://www.cs.princeton.edu/~chazelle/pubs/book.pdf
- Chazelle, B. (2000): The Soft Heap: An Approximate Priority Queue with Optimal Error Rate Journal of the Association for Computing Machinery 47 (6) 1012-1027
- Chazelle, B. (2000): A Minimum Spanning Tree Algorithm with Inverse-Ackerman Type Complexity Journal of the Association for Computing Machinery 47 (6) 1028-1047
- Kaplan, H., and U. Zwick (2009): A simpler implementation and analysis of Chazelle's Soft Heaps https://epubs.siam.org/doi/abs/10.1137/1.9781611973068.53?mobileUi=0
- Pettie, S., and V. Ramachandran (2008): Randomized Minimum Spanning Tree Algorithms using Exponentially Fewer Random Bits ACM Transactions on Algorithms 4 (1) 1-27
- Module = Computational Core Module
- Library = Graph Algorithm Library
- Project = Graph Optimization and Tree Construction Algorithms
- Package = Soft Heap - Approximate Priority Queue
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description KaplanZwickTree(KaplanZwickBinaryNode<KEY,ITEM> root)
KaplanZwickTree Constructor -
Method Summary
Modifier and Type Method Description static <KEY extends java.lang.Comparable<KEY>, ITEM>
KaplanZwickTree<KEY,ITEM>EquiRankTreeMerge(KaplanZwickTree<KEY,ITEM> tree1, KaplanZwickTree<KEY,ITEM> tree2)
Merge Two Trees with Identical Ranksstatic <KEY extends java.lang.Comparable<KEY>, ITEM>
KaplanZwickTree<KEY,ITEM>Initial(boolean minHeap, int r, PriorityQueueEntry<KEY,ITEM> entry)
Construct an Initial Tree with a single EntryKaplanZwickTree<KEY,ITEM>
next()
Retrieve the Next Tree in the ListKaplanZwickTree<KEY,ITEM>
prev()
Retrieve the Previous Tree in the Listint
rank()
Retrieve the Rank of the TreeKaplanZwickBinaryNode<KEY,ITEM>
root()
Retrieve the Root of the TreeKaplanZwickTree<KEY,ITEM>
rootTree()
Generate a Stand-alone Tree with the Root Node alone in its Listboolean
setNext(KaplanZwickTree<KEY,ITEM> next)
(Re-)set the Next Treeboolean
setPrev(KaplanZwickTree<KEY,ITEM> prev)
(Re-)set the Previous Treeboolean
setRoot(KaplanZwickBinaryNode<KEY,ITEM> root)
(Re-)set the Rootboolean
setSuffixExtremum(KaplanZwickTree<KEY,ITEM> suffixExtremum)
(Re-)set the Suffix Extremum TreeKaplanZwickTree<KEY,ITEM>
suffixExtremum()
Retrieve the Extremum ckey Tree among those following this in the Liststatic <KEY extends java.lang.Comparable<KEY>, ITEM>
booleanUpdateSuffixExtremum(KaplanZwickTree<KEY,ITEM> tree)
Update the Suffix Extremum of all Trees at and preceding the specified TreeMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
KaplanZwickTree
KaplanZwickTree Constructor- Parameters:
root
- Root of the Current Tree- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
-
Method Details
-
UpdateSuffixExtremum
public static <KEY extends java.lang.Comparable<KEY>, ITEM> boolean UpdateSuffixExtremum(KaplanZwickTree<KEY,ITEM> tree)Update the Suffix Extremum of all Trees at and preceding the specified Tree- Type Parameters:
KEY
- Key TypeITEM
- Item Type- Parameters:
tree
- Specified Tree- Returns:
- TRUE - Update Suffix Extremum successfully completed
-
EquiRankTreeMerge
public static <KEY extends java.lang.Comparable<KEY>, ITEM> KaplanZwickTree<KEY,ITEM> EquiRankTreeMerge(KaplanZwickTree<KEY,ITEM> tree1, KaplanZwickTree<KEY,ITEM> tree2)Merge Two Trees with Identical Ranks- Type Parameters:
KEY
- Key TypeITEM
- Item Type- Parameters:
tree1
- Tree #1tree2
- Tree #2- Returns:
- The Merged Tree
-
Initial
public static <KEY extends java.lang.Comparable<KEY>, ITEM> KaplanZwickTree<KEY,ITEM> Initial(boolean minHeap, int r, PriorityQueueEntry<KEY,ITEM> entry)Construct an Initial Tree with a single Entry- Type Parameters:
KEY
- Key TypeITEM
- Item Type- Parameters:
minHeap
- Min Heap Flagr
- The R Parameterentry
- The Entry- Returns:
- The Initial Tree with a single Entry
-
root
Retrieve the Root of the Tree- Returns:
- The Root
-
prev
Retrieve the Previous Tree in the List- Returns:
- The Previous Tree in the List
-
next
Retrieve the Next Tree in the List- Returns:
- The Next Tree in the List
-
suffixExtremum
Retrieve the Extremum ckey Tree among those following this in the List- Returns:
- The Extremum ckey Tree among those following this in the List
-
rank
public int rank()Retrieve the Rank of the Tree- Returns:
- Rank of the Tree
-
setRoot
(Re-)set the Root- Parameters:
root
- The Root- Returns:
- TRUE - The Root successfully (re-)set
-
setPrev
(Re-)set the Previous Tree- Parameters:
prev
- The Previous Tree- Returns:
- TRUE - The Previous Tree successfully (re-)set
-
setNext
(Re-)set the Next Tree- Parameters:
next
- The Next Tree- Returns:
- TRUE - The Next Tree successfully (re-)set
-
setSuffixExtremum
(Re-)set the Suffix Extremum Tree- Parameters:
suffixExtremum
- The Suffix Extremum- Returns:
- TRUE - The Suffix Extremum Tree successfully (re-)set
-
rootTree
Generate a Stand-alone Tree with the Root Node alone in its List- Returns:
- Stand-alone Tree with the Root Node alone in its List
-