|
|
вернуться в форумПоказать все сообщения Спрятать все сообщенияGreedy can pass this problem quickly. Edited by author 11.11.2012 02:32 of course greedy is correct. First sort the data according to finish time,than starting time. Suppose I have sorted the data by finish time and then by start time. Now what are you doing with the data? Are you binary searching over the data for each of the N events of the array? Please specify more. Useful test: 3 1 6 2 3 4 5 Answer: 2 Why won't greedy pass? Exactly this problem is used to teach greedy in most of all text books(all I have ever read). |
|
|