
LeetCode for IT Interview
LeetCode OJ is a platform for preparing technical coding interviews. LeetCode OJ 是专门给准备编程面试的在线代码判别平台。本专栏专门分享解题报告。
greenapple_shan
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode--online portal for IT interview
LeetCode--online portal for IT interview http://leetcode.com原创 2014-02-13 11:50:08 · 799 阅读 · 0 评论 -
LeetCode--Single Number
Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using ext原创 2014-05-06 18:42:40 · 620 阅读 · 0 评论 -
LeetCode--Maximum Depth of Binary Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Soluti原创 2014-05-07 17:15:20 · 684 阅读 · 0 评论 -
LeetCode--Reverse Integer
//#include #include #include //using namespace std; //const int MAXN=10; //int Stack[MAXN]; stack s; class Solution { public: int getNumber(int x) { //int lengthOfStack=0;原创 2014-05-09 20:49:50 · 889 阅读 · 0 评论 -
LeetCode--Search Insert Position
Search Insert Position Total Accepted: 14091 Total Submissions: 41005My Submissions Given a sorted array and a target value, return the index if the target is found. If not, return the in原创 2014-05-10 11:25:56 · 1009 阅读 · 0 评论 -
LeetCode--Same Tree
Same Tree Total Accepted: 16072 Total Submissions: 38790My Submissions Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal i原创 2014-05-13 09:46:44 · 910 阅读 · 0 评论 -
LeetCode--Binary Tree Preorder Traversal
Binary Tree Preorder Traversal Total Accepted: 18022 Total Submissions: 51784My Submissions Given a binary tree, return the preorder traversal of its nodes' values. For example: Given b原创 2014-05-14 12:47:02 · 867 阅读 · 0 评论 -
LeetCode--Single Number II
Single Number II Total Accepted: 14472 Total Submissions: 44420My Submissions Given an array of integers, every element appears three times except for one. Find that single one. Note: Y原创 2014-05-14 21:38:46 · 812 阅读 · 0 评论 -
LeetCode--Linked List Cycle
Linked List Cycle Total Accepted: 17148 Total Submissions: 49300My Submissions Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra sp原创 2014-05-14 22:17:31 · 847 阅读 · 0 评论 -
LeetCode--Minimum Depth of Binary Tree
本文先参考了http://www.cnblogs.com/remlostime/archive/2012/11/12/2766608.html 法一,递归 /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; *原创 2014-05-15 15:44:12 · 849 阅读 · 0 评论 -
LeetCode--Binary Tree Level Order Traversal
Binary Tree Level Order Traversal Total Accepted: 12441 Total Submissions: 40879My Submissions Given a binary tree, return the level order traversal of its nodes' values. (ie, from left t原创 2014-05-16 10:16:14 · 910 阅读 · 0 评论 -
LeetCode--Symmetric Tree
对于本题,想到一个中序遍历后,判别是否为回文串的方法,却WA多次 class Solution { public: vector vectorValue; void inOrder(TreeNode* root) { if(root!=NULL) { inOrder(root->left);原创 2014-05-16 14:27:12 · 874 阅读 · 0 评论