Sail E0 Webinar
Question
What is wrong with the following code of insertion in fibonacci heap.
Choose the correct optionFIB-INSERT(H, x) degree[x]= 0 p[x]=  NIL child[x] =NIL left[x] =x right[x] =x mark[x] =FALSE concatenate the root list containing x with root list H  if min[H] = NIL or key[x] > key[min[H]] then min[H]= x n[H]= n[H] + 1
Options:
A .  Line -11
B .  Line -3
C .  Line 9
D .  Line 7
Answer: Option C


The main characteristics of a Fibonacci heap is violated since min[H] must contain one with smallest value.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers