Click here to see the full article post
@bharath8 I'm assuming you're replying me though you don't @ me... Anyway, I think if we use a hash map, then we don't need to store every characters for every node, while if we use an array, no matter how many children this node have, we have to keep the array size of 26.. So why do you say hash map is more space efficient?
That is what forums are for right. share your ideas, opinions even with people whom you dont know? :). anyways, what about the worst case?
@bharath8 Yes, you're right. Share the views. By worst case, you mean every node has 26 valid children? Then the space in both methods are the same, right?
@FelixGEEK Suppose we choose an completely unspecified hash function, the efficiency of hashtable decreases as its load increases. So we need expand the size as its loadfactor reaches the threshold, which leads to more space cost
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.