86. Partition List
来源:互联网 发布:多源异构数据 编辑:程序博客网 时间:2024/06/05 04:07
class Solution {public: ListNode* partition(ListNode* head, int x) { vector<ListNode*> mins, maxs; ListNode *p = head; while(p){ if(p->val < x) mins.push_back(p); else maxs.push_back(p); p = p->next; } ListNode h(0); ListNode *t = &h; for(auto i : mins){ t->next = i; t = t->next; } for(auto j : maxs){ t->next = j; t = t->next; } t->next = NULL; return h.next; }};
阅读全文
0 0
- [LeetCode]86.Partition List
- LeetCode 86. Partition List
- [Leetcode] 86. Partition List
- LeetCode --- 86. Partition List
- 86. Partition List
- [leetcode] 86.Partition List
- [leetcode] 86. Partition List
- 86. Partition List
- [LeetCode]86. Partition List
- 86. Partition List
- 86. Partition List LeetCode
- 86. Partition List
- 86. Partition List
- 86. Partition List
- Leetcode 86. Partition List
- LeetCode *** 86. Partition List
- LeetCode 86. Partition List
- [LeetCode]86. Partition List
- 单例模式
- HQL中的select子句
- SpringBoot14-springboot核心-外部配置,日志配置,Profile配置
- JS序列化
- OpenCV 图像金字塔 pyrDown 和pyrUp函数
- 86. Partition List
- Android官方提供的支持不同屏幕大小的全部方法
- 寻找最大数(三)
- Invalid argument looking up property
- MyEclipse IDE中高效应用Hibernate
- win10+VS2015+CPU-Only安装与配置Caffe
- 机房登录系统(一)登录窗体
- linux 安装shadowsocks
- ProNEST 8.0 and 8.2.2_USB加密锁运行稳定完整版\