How would I make my custom generic type linked list in Java sorted?

后端 未结 3 1834
温柔的废话
温柔的废话 2021-01-24 23:44

I am writing my own linked list in java that is of generic type instead of using the java collections linked list. The add method for the linked list is made up of the followi

3条回答
  •  囚心锁ツ
    2021-01-25 00:05

    Does your implementation extend the java.util.List interface?

    Can you simply add the object to the list, then sort the list using Collections.sort()?

提交回复
热议问题