What does “Mutually Comparable” mean?

后端 未结 4 867
慢半拍i
慢半拍i 2021-01-07 07:19

I read that :

whenever a collection need to be sorted, the elements must be mutually comparable.

I wrote the below code and it

4条回答
  •  囚心锁ツ
    2021-01-07 07:38

    It means that for any two items in the collection, you must be able to compare A to B and vice versa.

提交回复
热议问题