Question To Be Done in O(N)

Правка en9, от rahul_1234, 2016-07-07 16:32:25

Hi, I wanted to solve this question in O(N) but couldn't think of it. I did it in O(N logN ) using priority queue but can somebody provide me O(N) solution.

https://postimg.org/image/c31iexg13/

The link of question is not opening now, so I have shared the pic of question.

Теги o(n)

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en9 Английский rahul_1234 2016-07-07 16:32:25 0 (published)
en8 Английский rahul_1234 2016-07-07 16:28:06 0 (saved to drafts)
en7 Английский rahul_1234 2016-07-07 16:27:30 11
en6 Английский rahul_1234 2016-07-07 16:03:50 2 Tiny change: '1iexg13/\nThe link' -> '1iexg13/\n\nThe link'
en5 Английский rahul_1234 2016-07-07 16:03:35 58
en4 Английский rahul_1234 2016-07-07 16:00:51 84
en3 Английский rahul_1234 2016-07-07 15:58:58 67
en2 Английский rahul_1234 2016-07-07 15:47:20 2 Tiny change: 'olution.\nhttps://' -> 'olution.\n\nhttps://'
en1 Английский rahul_1234 2016-07-07 15:46:57 227 Initial revision (published)