Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
proverbialbunny
on Dec 10, 2019
|
parent
|
context
|
favorite
| on:
Why databases use ordered indexes but programming ...
It depends on the hash table. Eg, in the D programming language if there is a collision instead of an array it uses a red-black tree.
This makes it effective O(1) but worse case O(log n).
denormalfloat
on Dec 10, 2019
[–]
Java does something similar, decaying its HashMap into a binary tree after enough collisions.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
This makes it effective O(1) but worse case O(log n).