0% found this document useful (0 votes)
46 views3 pages

Clear: Continue

The document describes testing operations on a Fibonacci heap including inserting elements, checking if the heap is empty, and clearing the heap. Elements are inserted into the heap and the resulting heap is displayed after each insertion. The empty status is checked after insertion and reports false, and then the heap is cleared and empty status correctly reports true.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views3 pages

Clear: Continue

The document describes testing operations on a Fibonacci heap including inserting elements, checking if the heap is empty, and clearing the heap. Elements are inserted into the heap and the resulting heap is displayed after each insertion. The empty status is checked after insertion and reports false, and then the heap is cleared and empty status correctly reports true.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

OUTPUT

FibonacciHeap Test

FibonacciHeap Operations

1. insert element
2. check empty
3. clear
1
Enter element
24

Heap = 24

Do you want to continue (Type y or n)

FibonacciHeap Operations

1. insert element
2. check empty
3. clear
1
Enter element
6

Heap = 6 24

Do you want to continue (Type y or n)

FibonacciHeap Operations

1. insert element
2. check empty
3. clear
1
Enter element
28

Heap = 6 28 24
Do you want to continue (Type y or n)

FibonacciHeap Operations

1. insert element
2. check empty
3. clear
1
Enter element
14

Heap = 6 14 28 24

Do you want to continue (Type y or n)

FibonacciHeap Operations

1. insert element
2. check empty
3. clear
1
Enter element
63

Heap = 6 63 14 28 24

Do you want to continue (Type y or n)

FibonacciHeap Operations

1. insert element
2. check empty
3. clear
2
Empty status = false

Heap = 6 63 14 28 24

Do you want to continue (Type y or n)


y

FibonacciHeap Operations

1. insert element
2. check empty
3. clear
3

Heap = Empty

Do you want to continue (Type y or n)

FibonacciHeap Operations

1. insert element
2. check empty
3. clear
2
Empty status = true

Heap = Empty

Do you want to continue (Type y or n)

BFS OUTPUT:

$javac BFS.java
$java BFS
Enter the number of nodes in the graph
4
Enter the adjacency matrix
0 1 0 1
0 0 1 0
0 1 0 1
0 0 0 1
Enter the source for the graph
1
The BFS traversal of the graph is
1 2 4 3

You might also like