T
T
tisprk2020-09-01 19:07:01
Java
tisprk, 2020-09-01 19:07:01

Why is HashSet faster than TreeSet?

Why is HashSet faster than TreeSet? Are all operations in hashset faster than in treeset?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-09-01
@tisprk

Because accessing a memory location with a known address is obviously faster than traversing a tree.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question