|
|
|
|
|
by gerbenst
2204 days ago
|
|
Yes that is very much possible. In general you won't get 4 equal length ranges though. For instance in an already sorted array the median results in (n/2,0) and a (0,n/2) division. But the average case should be two sets of merge intervals both of size (n/4, n/4). In reality I think you will quickly run into other limits. You need quite a bit of registers, that shouldn't spill to stack. |
|
If the array is already sorted then great; that split will just "merge":
which should go very fast. Anyhow, possible I'm missing something!