Office hours will take place between time T = 0 to T = 60mins and all students c
ID: 3674759 • Letter: O
Question
Office hours will take place between time T = 0 to T = 60mins and all students can potentially attend. Each student Si writes to the professor in advance by specifying a time interval (`i , ui) when he/she will attend office hours. Note that 0 `i < ui 60. Given the time intervals for the n students I1, . . . , In, find the maximum number of students who will be at the office hours at any point in time. Your algorithm should run in time (n log2 (n)). Example: Inputs n = 5 students and intevals are
I1 : (0, 15), I2 : (15, 20), I3 : (0, 22), I4 : (19, 20), I5 : (21, 40)
The maximum number of students at any time instant is 3. If a student i arrives at time t, and another student j leaves at the same time t, then we assume that the leaving happens before the arrival.
Explanation / Answer
Given in and out times of all student that reach a office.
We are given two arrays which represent arrival and departure times of student that stop
Examples:
Input: in[] = {9:00, 9:40, 9:50, 11:00, 15:00, 18:00%7
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.