Question: Write a C function to create an empty F-heap and support the following instructions. Each line in the input file represents one instruction. 1. insert
Write a C function to create an empty F-heap and support the following instructions. Each line in the input file represents one instruction. 1. insert x val : insert an element with key x 2. extract : print out the minimum in the heap and delete it 3. delete x val : delete the node which has key x and value val 4. decrease x val y : decrease the key by y on the node which has key x and value y 5. quit : terminate the program Note that all operations must leave behind properly structured F-heaps. Your functions for (3) and (4) must perform cascading cuts. Constraints 2147483648 , val 2147483647 1 2147483647 2 105, is number of instructions The key after decreasing will not exceed the boundary of 32-bit signed integer.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
