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.
Great suggestion. You are right.
No need of changing the boiler plate code.
But instead of setting the initial capacity using hash map, I used a linked hash map and that worked. Linked Hash Map doesn't have the added time complexity of resizing (i.e. everytime the length exceeds the default size)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Frequency Queries
You are viewing a single comment's thread. Return to all comments →
Great suggestion. You are right. No need of changing the boiler plate code. But instead of setting the initial capacity using hash map, I used a linked hash map and that worked. Linked Hash Map doesn't have the added time complexity of resizing (i.e. everytime the length exceeds the default size)