Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Provide the solution in Python You are assigned the task to automate the patient management system for a hospital. Three categories of patients visit the
Provide the solution in Python
You are assigned the task to automate the patient management system for a hospital. Three categories of patients visit the hospital: 1. Severely ill 2. Moderately ill 3. Regular check up Your system must be able to list the patients according to the seriousness, 1 being the most serious and 3 being the least. Moreover, the system must be able to handle incoming patients while doctors are checking other patients. Solving this problem requires knowledge of Queue which you have learnt in CSE220. Input: The input file will contain names of the patients as strings with a priority ( 1 , 2 or 3) associated with each name and an operation called "see doctor." When the "see doctor" function will be called one patient from the queue, of course the patient who came first with seriousness 1 , will be served first. ABC3 EWQ3 SDF 2 KLM 1 see doctor see doctor FDS 1 OPN 3 TYU 3 see doctor XCV 2 see doctor see doctor Output: Every time the "see doctor" function is called, erase the correct patient from the queue and print the name. Methodology: Create a function called enque(name of the patient) which will insert the name in the queue (use a list). Create a function called seeDoctor() which will basically deque the correct patient from the queue. Create a function named printQueue() which will print all the patients in the queue. You may create additional functions needed to solve the problem. Use a list as the queue. a) You must build this system in 2 ways. Use the bubble sort algorithm everytime a new patient comes in, where you sort the patients according to the seriousness and delete when seeDoctor method is called. b) The second way is to use heap sort. Everytime a patient comes in you heapify (swim up) and sink when the seeDoctor method is called. c) Do you see any difference in output when you call the seeDoctor( ) function ? If yes, what do you think is the reason? If you don't see any difference do not panic. As long as the correct patient is sent to the doctor your system is correct. d) You then compare the time complexity of the 2 techniques by plotting a line graph input in the x axis and time taken in the y axis. See lab 1 to solveStep 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