You are viewing a single comment's thread. Return to all comments →
You could store the original index of the number alongside each before sorting (as a 2D array).
Or you store each cost with its index in a hash table, but then if you're using hashtable why do you need to binary search.....
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 →
You could store the original index of the number alongside each before sorting (as a 2D array).
Or you store each cost with its index in a hash table, but then if you're using hashtable why do you need to binary search.....