this is for holding javascript data
Niclas Alexandersson edited b) Find the assignment of the rooms.tex
almost 10 years ago
Commit id: 3ad7eefa666d66afd9622cc71ed656e0792efad7
deletions | additions
diff --git a/b) Find the assignment of the rooms.tex b/b) Find the assignment of the rooms.tex
index 90e94a8..d10635b 100644
--- a/b) Find the assignment of the rooms.tex
+++ b/b) Find the assignment of the rooms.tex
...
\section{b) Find the assignment of the rooms}
\begin{verbatim}
def efficient_lsp(courses):
courses <- sorted(courses, key=lambda c: c.start())
days <- priority_queue(sorted: key=lambda d: d.getLast().finish())
for i in courses:
day <- []
if len(days) > 0 and !collides(i, days.peekFirst().getLast()):
day <- collisions.removeFirst()
day.addLast(i)
days.add(day)
return asList(days)
\end{verbatim}