时间挤挤总是有的太久不做题,脑子都生锈了。来道水题练练手题目地址:https://leetcode.com/problems/binary-search-tree-iterator/题目内容:Implement an iterator over a binary search tree (BST)....
分类:
其他好文 时间:
2015-08-30 00:56:27
阅读次数:
155
点击打开题目链接https://www.codechef.com/problems/SETDIFF
Set Difference
Problem code: SETDIFF
SUBMIT
ALL SUBMISSIONS
All submission...
分类:
其他好文 时间:
2015-08-29 23:17:19
阅读次数:
181
?Make Sure the Simple Stuff Is SimpleChad LaVigneSoFTWARE ARCHiTECTS SolvE a lot of very difficult problems but we also solve some relatively easy ones. What we don’t want to do is apply a compli- cate...
分类:
其他好文 时间:
2015-08-29 12:50:15
阅读次数:
162
https://leetcode.com/problems/valid-anagram/“桶”的思想,通过统计每个字符出现的频率可以得到两个单词是否同构。 1 class Solution { 2 public: 3 bool isAnagram(string s, string t) { ...
分类:
其他好文 时间:
2015-08-28 19:36:26
阅读次数:
167
https://leetcode.com/problems/flatten-binary-tree-to-linked-list/二叉树先序遍历,之后做成链表 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4.....
分类:
其他好文 时间:
2015-08-28 19:32:28
阅读次数:
133
1、题目名称 Add Two Numbers (两个链表逐项做带进位的加法生成新链表) 2、题目地址 https://leetcode.com/problems/add-two-numbers/ 3、题目内容 英文:You are given two linked lists representing two non...
分类:
其他好文 时间:
2015-08-28 01:00:03
阅读次数:
118
from leetcode?https://leetcode.com/problems/verify-preorder-sequence-in-binary-search-tree/ 比如序列 2, 1, 3 是如下图的BST的preorder 序列: 但是2, 3, 1就不会是一个preorder序列; 先复习一下BST,给...
分类:
其他好文 时间:
2015-08-27 23:19:14
阅读次数:
681
题目链接:https://leetcode.com/problems/valid-anagram/
题目:
Given two strings s and t, write a function to determine if t is an anagram of s.
For example,
s = "anagram", t = "nagaram", return true.
...
分类:
其他好文 时间:
2015-08-27 18:49:59
阅读次数:
177
【 声明:版权所有,转载请标明出处,请勿用于商业用途。 联系信箱:libin493073668@sina.com】
题目链接:https://leetcode.com/problems/merge-sorted-array/
题意:
给定两个已经排好序的数组,然后要你把第二个数组合并到第一个去
思路:
先用两个标记指向两个数组的第...
分类:
其他好文 时间:
2015-08-27 18:49:54
阅读次数:
148
题目链接:https://leetcode.com/problems/balanced-binary-tree/
题目:
Given a binary tree, determine if it is height-balanced.
For this problem, a height-balanced binary tree is defined as a binary tree...
分类:
其他好文 时间:
2015-08-27 18:44:11
阅读次数:
185