Блог пользователя ss_96

Автор ss_96, история, 6 лет назад, По-английски

I read a heap solution at the following link:link but cannot figure out that solution,can anyone please provide some pseudo-code or some explanation for the solution using heaps.

Thank you for your time.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Is there any algorithm to solve this problem in less than $$$O(n^2)$$$? Preferably using graphs.