Skip to main content
3 of 4
format to be in two lines
Jamal
  • 34.9k
  • 13
  • 133
  • 237

You have two variables that aren't actually needed:

  • newNode: when inserting smaller than the first.

  • prevTmp: when inserting after while. It can be tmpNode.