What is the space complexity of a Hash Table?

Technology CommunityCategory: Data StructuresWhat is the space complexity of a Hash Table?
VietMX Staff asked 3 years ago

The space complexity of a datastructure indicates how much space it occupies in relation to the amount of elements it holds. For example a space complexity of O(1) would mean that the datastructure alway consumes constant space no matter how many elements you put in there. O(n) would mean that the space consumption grows linearly with the amount of elements in it.

hashtable typically has a space complexity of O(n).