Professional Documents
Culture Documents
Data Structures - Lab 10: Submission Deadline: 3 December 2021, 12:50 PM
Data Structures - Lab 10: Submission Deadline: 3 December 2021, 12:50 PM
Note:
This is a strictly individual work. Sharing the solution with each other will be considered as
violation of the honor code and any suspicious activity may be referred to the disciplinary
committee. In case of any help, please consult the instructor.
You can’t use any built-in function to implement following tasks.
Submission Deadline: 3 December 2021, 12:50 PM.
Total Marks:
Exercises
After every 3 seconds, call Add_job () or Delete_job (). Using random number, decide
whether Add-job () or Delete_job () is to be called.
Note: Value of the priority must be greater than 0. And if there are many jobs in the
Queue then the job with the lowest value of the attribute ‘priority’ should be removed
2. Write a function Is-Heap() which takes an array as input and returns true if the given
array represents a Min-Heap otherwise returns false.
4. Your program should display a menu of choices to operate the Min-Heap. See the
sample menu below:
a. Insert (add a value in the Min-Heap)
b. Delete (delete lowest value from the Min-Heap)
c. display (show all the values present in the Min-Heap)
if user enters ‘a’, take a value as input and add it in the heap and if ‘b’ is given as in-
put then delete the minimum value from the heap while on ‘c’, heap should be dis-
played.