-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLeftHeapNode.java
More file actions
30 lines (25 loc) · 895 Bytes
/
Copy pathLeftHeapNode.java
File metadata and controls
30 lines (25 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package DataStructures.Heap;
import DataStructures.Comparable;
// Basic node stored in leftist heaps
// Note that this class is not accessible outside
// of package DataStructures
class LeftHeapNode
{
// Constructors
LeftHeapNode( Comparable theElement )
{
this( theElement, null, null );
}
LeftHeapNode( Comparable theElement, LeftHeapNode lt, LeftHeapNode rt )
{
element = theElement;
left = lt;
right = rt;
npl = 0;
}
// Friendly data; accessible by other package routines
Comparable element; // The data in the node
LeftHeapNode left; // Left child
LeftHeapNode right; // Right child
int npl; // null path length
}