putin
BAN USER
Comments (2)
Followers (4)
Reputation 70
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Page:
1
RepJesseDavis, Animator at 8x8
Hey I am Jack from us. I am working as a professor in MIT university.i Love my profession and ...
Repmandybourne5463, Accountant at ABC TECH SUPPORT
MandyBourne, and I am a Computer typesetter and I love my work. Apart from this, today I am doing new ...
RepRoseReynolds, Analyst at 8x8
Hi everyone I am Lilla from the UK.I am passionate about two things, gym and book lover.Last topic ...
RepRuthOrvis, AT&T Customer service email at 8x8
Hey I am Ruth Working as a branch manager in a bank.I have worked here for the last 4 ...
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
A greedy algorithm doesn't guarantee scheduling the maximum number of meetings. This problem can be mapped to a conflict graph: every meeting can be mapped to a vertex in a graph. If two meetings have overlap (conflicts), they share an (undirected) edge in the graph. Now the question becomes a variant of vertex coloring problem where two adjacent vertices don't share the same color (two conflict meetings cannot share the same room).
- putin July 10, 2015To optimally solve this, a backtracking solution can do the job, but with two cases:
1. if the graph is k-colorable, just return N
2. if the graph is not k-colorable, increase k until it's m-colorable (m>k). Now you will get m set of vertices. Sort them with non-increasing order of set sizes and return the total size of the first k sets.