Sunday, February 16, 2014

LEFTIST HEAP OUTPUT

OUTPUT:

C:\jdk1.3\bin>java LeftistHeapTest
                 --LeftistHeap--
1. Insertion
2. Deletion
3. Exit..
Enter your choice:
1
Enter the number of elements
7
Enter the values to insert
10
Enter the values to insert
32
Enter the values to insert
54
Enter the values to insert
22
Enter the values to insert
10
Enter the values to insert
12
Enter the values to insert
87







PRINTING ALL NODES:
Root:  depth == 0, key == 10
Left:  depth == 1, key == 10
Left:  depth == 2, key == 22
Left:  depth == 3, key == 54
Right: depth == 2, key == 12
Right: depth == 1, key == 32
Left:  depth == 2, key == 87

Enter your choice:
2
The deleted item is :  10

PRINTING ALL NODES:
Root:  depth == 0, key == 10
Left:  depth == 1, key == 22
Left:  depth == 2, key == 54
Right: depth == 1, key == 12
Left:  depth == 2, key == 32
Left:  depth == 3, key == 87

Enter your choice:
3

PRINTING ALL NODES:
Root:  depth == 0, key == 10
Left:  depth == 1, key == 22
Left:  depth == 2, key == 54
Right: depth == 1, key == 12
Left:  depth == 2, key == 32
Left:  depth == 3, key == 87









No comments:

Post a Comment