Does Hashmap or Nested Loop use more memory?
hi, i want to know if a hashmap or a for loop with another nested for loop use more memory?
in my case, i have a for loop that iterates 10 times and stores entries into the hashmap if appropriate, with key type String and value type Integer, and the number of entries could be somewhere from 3 to 6...
so does this use more memory compared to a for loop that iterates about 10 times with a nested for loop that also iterates at worst 10 times..
also, i know the hashmap is faster in this case but does it use more memory?