会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
红桃J
用心写好每行完美的代码,远比写一堆更有价值
博客园
::
首页
::
博问
::
闪存
::
新随笔
::
联系
::
订阅
::
管理
::
公告
2015年5月11日
leetcode Maximum Depth of Binary Tree
摘要: 代码:/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : va...
阅读全文
posted @ 2015-05-11 22:36 红桃J
阅读(91)
评论(0)
推荐(0)
leetcode single number
摘要: 异或运算的使用代码: 1 int singleNumber(int* nums, int numsSize) { 2 int i, result = nums[0]; 3 if(numsSize<=0) 4 return 0; 5 f...
阅读全文
posted @ 2015-05-11 22:24 红桃J
阅读(139)
评论(0)
推荐(0)
leetcode Search in Rotated Sorted Array
摘要: 代码: 1 #include 2 #include 3 4 using namespace std; 5 6 int search(vector& nums, int target) 7 { 8 int L = nums.size(); 9 int k = 0;10 i...
阅读全文
posted @ 2015-05-11 19:07 红桃J
阅读(135)
评论(0)
推荐(0)
Leetcode Longest Valid Parentheses
摘要: 错误代码: 1 #include 2 3 using namespace std; 4 5 int longestValidParentheses(string s) 6 { 7 int i = 0; 8 int L = s.length(); 9 int j;10 ...
阅读全文
posted @ 2015-05-11 11:32 红桃J
阅读(131)
评论(0)
推荐(0)
leetcode Valid Sudoku
摘要: 代码: 1 #include 2 #include 3 4 using namespace std; 5 6 int length = 9; 7 8 bool isValidSudoku(vector>& board) 9 {10 int flag[9];11 memset(...
阅读全文
posted @ 2015-05-11 09:34 红桃J
阅读(163)
评论(0)
推荐(0)