【LeetCode】 86. Partition List C语言
来源:互联网 发布:天津基础教研网络平台 编辑:程序博客网 时间:2024/06/15 01:02
LeetCode解题心得,欢迎交流! 第三日
/** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */struct ListNode* partition(struct ListNode* head, int x) { struct ListNode *dummy1=(struct ListNode *)malloc(sizeof(struct ListNode)); struct ListNode *dummy2=(struct ListNode *)malloc(sizeof(struct ListNode)); struct ListNode *cur1=dummy1; struct ListNode *cur2=dummy2; while(head!=NULL) { if(head->val < x) { cur1->next=head; cur1=head; } else { cur2->next=head; cur2=head; } head=head->next; } cur2->next=NULL; cur1->next=dummy2->next; return dummy1->next;}
0 0
- 【LeetCode】 86. Partition List C语言
- [C语言][LeetCode][86]Partition List
- [LeetCode]86.Partition List
- LeetCode 86. Partition List
- [Leetcode] 86. Partition List
- LeetCode --- 86. Partition List
- [leetcode] 86.Partition List
- [leetcode] 86. Partition List
- [LeetCode]86. Partition List
- 86. Partition List LeetCode
- Leetcode 86. Partition List
- LeetCode *** 86. Partition List
- LeetCode 86. Partition List
- [LeetCode]86. Partition List
- LeetCode 86. Partition List
- leetcode 86. Partition List
- Leetcode 86. Partition List
- LeetCode-86.Partition List
- Java学习之形式参数,返回值
- 跑步与不跑步的人,区别,在十年之后 跑者心语
- Centos 基础开发环境搭建之Maven私服nexus
- 数据库中索引的优缺点
- RGB565 to gray
- 【LeetCode】 86. Partition List C语言
- python 字符串(str)转换为元组.md
- mysql
- SICP 1.45 n次方根
- unity 一个mesh renderer上有两个材质球更换材质球的方法
- 代码结构中Dao,Service,Controller,Util,Model是什么意思
- C语言支不支持重载?
- 约瑟夫问题
- 深入理解Handler