How is a hashmap implemented, how do you avoid hash collisions, and what strategy do you use during resizing to maintain amortized time complexity?