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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started