Reversing a linked list

前端 未结 5 1010
萌比男神i
萌比男神i 2021-01-17 06:48

Problem in Reversing a linked list without using recursion.

I used this method, but when i try and run this back home, I am not able to print the reverse of the lin

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-17 07:29

    check your condition: while (isEmpty(head))

    you forgot to add the "!" you meant while not empty... do

提交回复
热议问题