reversing linked list

后端 未结 9 1184
星月不相逢
星月不相逢 2020-12-10 16:52

I am trying to reverse a linked list using recursion and wrote the following code for it. The list is start of the list at the beginning.

 node *reverse_lis         


        
9条回答
  •  暖寄归人
    2020-12-10 17:26

    Some problems I could see:

    • You need to make the next pointer of the new last node NULL.
    • You existing function will blow if I pass NULL to it initially.

提交回复
热议问题