上一页 1 ··· 7 8 9 10 11
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *... 阅读全文
posted @ 2015-07-20 09:51 *桔子* 阅读(354) 评论(0) 推荐(0)
摘要: class Solution {public: int findPeakElement(vector& nums) { int i=0; int n=nums.size(); while(inums[i+1])) return i; ... 阅读全文
posted @ 2015-07-17 10:08 *桔子* 阅读(138) 评论(0) 推荐(0)
摘要: #includeusing namespace std;class Solution {public: string convertToTitle(int n) { string res; if(n<=0) return ""; while(n) { ... 阅读全文
posted @ 2015-07-16 22:49 *桔子* 阅读(186) 评论(0) 推荐(0)
摘要: #includeusing namespace std;class Solution {public: int majorityElement(vector& nums) { map m; int n=nums.size(); int i=0; while(i(nums[i],1)... 阅读全文
posted @ 2015-07-16 21:59 *桔子* 阅读(176) 评论(0) 推荐(0)
摘要: class Solution {public: int trailingZeroes(int n) { if(n<=0) return 0; int i=0; int res=0; while(n){ ... 阅读全文
posted @ 2015-07-16 21:11 *桔子* 阅读(247) 评论(0) 推荐(0)
摘要: class Solution {public: void rotate(vector& nums, int k) { int n=nums.size(); int i=0;//-------------------//解法一 会超时//-----... 阅读全文
posted @ 2015-07-16 10:44 *桔子* 阅读(171) 评论(0) 推荐(0)
摘要: class Solution {public: ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) { ListNode *p; ListNode *p1=p; while(l1!=NULL && l2!=NULL){ if((l1->val)... 阅读全文
posted @ 2015-07-14 09:57 *桔子* 阅读(212) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11