You are viewing a single comment's thread. Return to all comments →
If the costs were given in order, a linear search for the sum starting from both ends does the job instead of doing a binary search in every step.
Seems like cookies are disabled on this browser, please enable them to open this website
Hash Tables: Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
If the costs were given in order, a linear search for the sum starting from both ends does the job instead of doing a binary search in every step.