qingcheng奕 |
|
||
2014年2月13日
摘要:
http://oj.leetcode.com/problems/partition-list/链表的处理#include using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution {public: ListNode *partition(ListNode *head, int x) { ListNode *head1 = NULL,*head2 = NULL,*tai... 阅读全文
摘要:
http://oj.leetcode.com/problems/reverse-linked-list-ii/链表的操作#include using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution {public: ListNode *reverseBetween(ListNode *head, int m, int n) { ListNode dummy(-1); ... 阅读全文
摘要:
http://oj.leetcode.com/problems/3sum/找出三个数的和是0的元组.class Solution {public: vector > threeSum(vector &num) { vector > ans; if(num.size()0) break; if(num[i]+num[j]+num[num.size()-1] onePiece; onePiece.push_back(num[... 阅读全文
|
Copyright © 2024 qingcheng奕
Powered by .NET 8.0 on Kubernetes |