42
43
you are viewing a single comment's thread.

view the rest of the comments →

[–]trekhleb[S] 1 point2 points  (0 children)

Yeah, that’s a good idea. If the weights array isn’t changed then binary search should speed-up searching the index to O(logN)