Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
pxndx
· 8y ago · 0 comments
Runs can be increasing or decreasing, a reversed array is a single run. Worst case is n/2 because you can always split the array in pairs (if it alternates a high and a low value for example).
Comments
[–]
Fri31Aug
8y ago
Ah I didn't know it also exploited reversed runs. Amazing.