Questions tagged [median-of-medians]

The median-of-medians algorithm is a deterministic, worst-case O(n)-time algorithm for the selection problem (given a list of values, find the kth largest value). The constant factor in the O(n) is large, and the algorithm is not commonly used in practice.

62 questions
-3
votes
1 answer

Fixing a Median of Medians method I self translated from an algorithm

I'm copying this algorithm straight from a book, but I keep getting an ArrayIndexOutOfBoundsException at the "ERROR HERE!!!!" part... for the T[i] = ... It's driving me nuts and I need to get this done... can someone suggest how I can fix this? I…
user1189352
  • 3,534
  • 9
  • 43
  • 77
-3
votes
2 answers

Median in 500GB file java

Find median of all numbers in the given 500GB file at the command prompt. File format eg: 12 4 98 3 with one number in each line(numbers can be repeated).Can anyone please help on how to approach on this in JAVA? if we have to split the file and…
Siri
  • 15
  • 1
1 2 3 4
5