Farhan Ali1 month agoMost voted8
It starts as a linked list, but when one bucket gets more than 8 entries it's converted to a red-black tree, so the worst case becomes O(log n). Only if the table capacity is at least 64 though, below that it resizes instead.