Skip to main content
deleted 1 character in body
Source Link
Jamal
  • 34.9k
  • 13
  • 133
  • 237
  1. Your implementation does not allow for an empty list.

    Your implementation does not allow for an empty list.

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

  3. You should probably implement the List interface.

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

  5. 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).

  6. In insert() and delete() you have some if-conditions followed by a while-loop. My guess is that they can be merged in a single while-loop. I was lazy and haven't tried doing it, so it might not be true.

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).

  4. In insert() and delete() you have some if-conditions followed by a while-loop. My guess is that they can be merged in a single while-loop. I was lazy and haven't tried doing it, so it might not be true.

  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).

  4. In insert() and delete() you have some if-conditions followed by a while-loop. My guess is that they can be merged in a single while-loop. I was lazy and haven't tried doing it, so it might not be true.

  1. Your implementation does not allow for an empty list.

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

  3. You should probably implement the List interface.

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

  5. 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).

  6. In insert() and delete() you have some if-conditions followed by a while-loop. My guess is that they can be merged in a single while-loop. I was lazy and haven't tried doing it, so it might not be true.

added 221 characters in body
Source Link
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).

  4. In insert() and delete() you have some if-conditions followed by a while-loop. My guess is that they can be merged in a single while-loop. I was lazy and haven't tried doing it, so it might not be true.

  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).

  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).

  4. In insert() and delete() you have some if-conditions followed by a while-loop. My guess is that they can be merged in a single while-loop. I was lazy and haven't tried doing it, so it might not be true.

Source Link
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).