We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
HOLD ON. I just reviewed the YouTube video from Gayle McDowell on this; and the reason why this is actually a Binary Search problem rather than a HashMap problem is this: For the case where you have two different ice cream flavors with the same cost. You need to be able to distinguish between them; and a HashMap from Cost to Flavor overwrites with the latest Flavor value for the same Cost Key. I worked through the coding solution to this with hints from that video here: https://www.youtube.com/watch?v=Ifwf3DBN1sc
Hash Tables: Ice Cream Parlor
You are viewing a single comment's thread. Return to all comments →
HOLD ON. I just reviewed the YouTube video from Gayle McDowell on this; and the reason why this is actually a Binary Search problem rather than a HashMap problem is this: For the case where you have two different ice cream flavors with the same cost. You need to be able to distinguish between them; and a HashMap from Cost to Flavor overwrites with the latest Flavor value for the same Cost Key. I worked through the coding solution to this with hints from that video here: https://www.youtube.com/watch?v=Ifwf3DBN1sc