Skip to main content
1 of 3
toto2
  • 5.4k
  • 16
  • 21
  1. Your implementation does not allow for an empty list.

1.1) It's a bit odd to only have the constructor which takes a node value.

  1. You should probably implement the List interface.

  2. You should look into generics instead of hard-coding your list to only take ints.

  3. It looks like from looking at insert() that you are trying to create an ordered linked list. However, append() does not. (If you really want to define an ordered linked list, you can still use generics, but you'll have to use types which are children of Comparable).

toto2
  • 5.4k
  • 16
  • 21