+ 1

Can anyone suggest a program in C or Java to find the median of an array without sorting it ?

20th Apr 2019, 2:39 PM
Avin James
Avin James - avatar
3 Antworten
+ 1
how??
8th Apr 2022, 7:17 PM
I Gede Darmawan Adi Pratama Putra
0
The median, by the definition, is the center element of a SORTED array (or the half sum of the two in the center if the array has an even number of elements). If you want to find the median without sorting, make sure your input is sorted :)
20th Apr 2019, 6:01 PM
Alexander Velinov
Alexander Velinov - avatar
0
I found out the code. You can actually find median without sorting
20th Apr 2019, 10:49 PM
Avin James
Avin James - avatar