Home > Back-end >  What are some sort of implementation TreeSet rules
What are some sort of implementation TreeSet rules

Time:09-20

Have which some sort of implementation TreeSet rules, thank you wang!

CodePudding user response:

https://blog.csdn.net/qq_36748278/article/details/77915801? Utm_medium=distribute. Pc_relevant. None - task - blog - BlogCommendFromMachineLearnPai2-2. Nonecase& Depth_1 - utm_source=distribute. Pc_relevant. None - task - blog - BlogCommendFromMachineLearnPai2-2. Nonecase

CodePudding user response:

Realize the external comparator, or implement internal comparable

CodePudding user response:

TreeSet is a sort of rules, we often say the TreeSet characteristics, is that the TreeSet itself is orderly, according to the size of the object in order well,

Orderly collection, there are two major categories, the List and TreeSet, a List of order, refers to the sequence that is put in the collection and TreeSet order, refers to put the size of the object,

In this and sorting algorithm is not too big relations, sorting algorithm to a order no size set into according to the size of the set of methods,
And TreeSet is orderly, so far from what the sorting algorithms,

TreeSet set, an object is stored in the form of a binary tree is adopted to improve the collection object storage, left and right subtrees relationship can always stay the same size,
  • Related