LeeCode 单链表逆序
来源:互联网 发布:黄思路 知乎 编辑:程序博客网 时间:2024/06/05 15:20
题目:Reverse a singly linked list
C代码:
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */struct ListNode* reverseList(struct ListNode* head) { if(NULL==head||NULL==head->next) return head; struct ListNode *p=head->next; head->next=NULL; struct ListNode *newhead=reverseList(p); p->next=head; return newhead; }
1 0
- LeeCode 单链表逆序
- leecode
- LeeCode
- LeeCode 连接两个有序单链表
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 【单链表】逆序
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 单链表逆序
- 打开MYSQL时出现闪退lost connection to mysql server at 'reading initial communication packet' system error
- 设计模式之工厂模式 --- Java
- CSAPP课程实验 bomb实验 拆炸弹实验 (2)
- LCD驱动移植配置总结
- gxx_slide之城市规划2
- LeeCode 单链表逆序
- ubuntu下sudo apt-get update Sources 404 Not Found [IP: 91.189.92.200 80]解决办法
- C#之连接数据库:Connection对象
- Modbus从机(服务器)通讯设计
- C++函数isdigit
- [android]Broadcast与BroadcastReceiver
- [VC++]限制CEdit(Edit Contrl)只能输入数字和小数点
- 在Eclipse中集成Genymotion模拟器插件
- 关于获取 Android 中从res/values/strings.xml 应用名称的 字符串