I've gone with the first binary search, but changed it to look for a value inside the window. Once found, then I can just go up and down the list and populate the array until it hits one of the window limits. Then fill out the rest of the array with MIN or MAX values. So only one binary search needed.
I had never seen Memoize before, using that.
The class idea is great, but probably overkill in this case.
In reply to Re^2: Special binary search
by olepi
in thread Special binary search
by olepi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |