Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl...
分类:
其他好文 时间:
2015-04-12 11:48:52
阅读次数:
100
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
For example:
Given the following binary tree,
1 ...
分类:
其他好文 时间:
2015-04-12 10:41:52
阅读次数:
149
Binary Tree Right Side ViewGiven a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered fr...
分类:
其他好文 时间:
2015-04-11 19:09:34
阅读次数:
124
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
For example:
Given the following binary tree,
1...
分类:
其他好文 时间:
2015-04-11 17:52:51
阅读次数:
109
二叉查找树(Binary Search Tree)也称二叉搜索树、有序二叉树(ordered binary tree),排序二叉树(sorted binary tree),是指一棵空树或者具有下列性质的二叉树:若任意节点的左子树不空,则左子树上所有结点的值均小于它的根结点的值;若任意节点的右子树不空...
分类:
其他好文 时间:
2015-04-11 17:47:51
阅读次数:
121
如果字符串数组只有一个,那么最长前缀就是它本身;如果有多个,我们把第一个设为当前最长前缀,拿当前最长前缀去和第二个比较,再选出最长前缀,一次往后即可!代码:#include#include#includeusing namespace std;string longestCommonPrefix(v...
分类:
其他好文 时间:
2015-04-11 16:09:23
阅读次数:
131
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For exam...
分类:
其他好文 时间:
2015-04-11 07:49:20
阅读次数:
107
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest...
分类:
其他好文 时间:
2015-04-11 01:18:51
阅读次数:
113
??
问题描述:Write a function to find the longest common prefix stringamongst an array of
strings.
问题分析:
代码:
public class Solution {
public String longestCommonPrefix(String[] strs) {
...
分类:
其他好文 时间:
2015-04-10 22:11:48
阅读次数:
106
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2015-04-10 19:43:32
阅读次数:
102