Simran Dass wrote:Does searching an element in a hasmap depend on the hashmap's size ?
Does removing an element from a hasmap depend on the hashmap's size ?
What do you mean?
Did you want to ask about the speed, i.e. if searching or removing an element takes longer if the HashMap contains more elements? (If that's what you mean then why didn't you say so?). Obviously yes, if the HashMap contains more elements, then searching for an element or removing an element takes longer. It doesn't scale linearly though (if the HashMap contains twice as much elements, it does not mean that searching for an element takes twice as long).