Java. TreeSet successor

I am interested in such a question: as we know, *Red-Black tree* provides efficient implementation of such operations as *successor* (the first element higher that entry) and *predecessor* , i.e. in log - time. In **Java documentation** is written that for providing such operation as successor you may merely use subSet and then took the least element in the **subSet**. But is it log-time? If it is, what is the implementation of **subSet**?(I am interested in the algorithm, so it may be just few words, not necessary code) Thanks.
I'm not sure I get the question: HashSet does have methods lower(E e) and higher(E e).

以上就是Java. TreeSet successor的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准