Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need to write C program input_01.txt - insert 11001 insert 21002 insert 1001001 delete 1001001 insert 31003 insert 41004 insert 1001001 delete 1001001 insert 51005
Need to write C program
input_01.txt - insert 11001 insert 21002 insert 1001001 delete 1001001 insert 31003 insert 41004 insert 1001001 delete 1001001 insert 51005 insert 61006 insert 1001001 delete 1001001 insert 71007 insert 81008 insert 1001001 de7ete 1001001 de7ete 61006 de7ete 71007 decrease 410041000 extract extract extract extract extract extract extract insert 17 insert 19 insert 13 de7ete 113 delete 17 extract extract quit output_01.txt - |(-996) 1004 (1) 1001 (2) 1002 (3) 1003 (5) 1005 (8) 1008 (1) 9 Problem 2 : Priority Queue (5\%) 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 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 - 2147483648x, val 2147483647 - 1y2147483647 - 2n105,n is number of instructions - The key after decreasing will not exceed the bound 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