find sum of i/2 smallest numbers in array at index i

Правка en1, от anucode, 2024-05-17 13:33:38

We have an array of integer and we want at evey odd index i we have to find sum of first i/2 smallest number from index 1 to index i lets at index i is equal to At index 1 sum of 0 smallest number At index 3 sum of first one smallest number At index 5 sum of first two smallest number At index 7 sum of first three smallest number At index 9 sum of first four smallest number and so on. any solution in o(n) or o(nLogn) ?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский anucode 2024-05-17 13:48:11 5 Tiny change: 'y solution in o(n) o' -> 'y solution/Idea in o(n) o'
en4 Английский anucode 2024-05-17 13:39:00 16
en3 Английский anucode 2024-05-17 13:36:33 22 Tiny change: 'x i\nlets at index i is equal to\nAt index' -> 'x i\nlets \nAt index'
en2 Английский anucode 2024-05-17 13:34:21 5
en1 Английский anucode 2024-05-17 13:33:38 482 Initial revision (published)