会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
julie_yang
博客园
首页
新随笔
联系
管理
订阅
上一页
1
···
7
8
9
10
11
2015年7月20日
两个链表交集
摘要: /** * 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)
2015年7月17日
peak num
摘要: 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)
2015年7月16日
数字转表格标题 Excel Sheet Column Title
摘要: #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)
Majority Element
摘要: #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)
n阶乘 尾数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)
rotate array 旋转数组
摘要: 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)
2015年7月14日
两个升序链表的合并 Merge Two Sorted Lists 【 leetcode】
摘要: 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
公告