Farha A Because the currently occupied lecture halls are put inside a priority queue on the basis of time when they become available. Since hall 2 becomes available earlier than halls 1 and 2, we schedule the next lecture in hall 2.
I have a question, how can we implementing greedy in order to optimize/decide total group class based on the resource (slot that available for each classroom)?
Sir, it would be helpfull to complete this discussion of room allotment, if you elborate on what will be the greedy approach for "how to maximize number of lecture out of N given intervals for fixed given K rooms?".
Sorry for the late answer. This problem belongs to class P since it is solvable in polynomial runtime (O(n log n)). P is a subset of NP so it also belongs to NP. It is not in NPC, unless P=NP.