Is Java Treeset faster than arraylist? Want to be different

recently, when I looked at JCF, I found this sentence on the Internet. when searching a large amount of information, TreeSet is more efficient than ArrayList and can guarantee the completion of

within the time of log (n).

Treeset is a tree structure. The search is O (log (n))
, but ArrayList is O (1). Obviously, this is fast

.

I don"t know where I understand it correctly


search is a search operation, a known element, a search index. You're talking about known indexes, looking for elements, just the opposite

.
Menu