Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.[Solution]先序定根,...
分类:
其他好文 时间:
2015-02-18 11:47:49
阅读次数:
151
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:
其他好文 时间:
2015-02-18 11:45:52
阅读次数:
129
Assume you have installed OpenCV Pack @ D:\opencv\Firstly , New-->Java Project .Assume the project name is cv_helloworldThen right click on the projec...
分类:
系统相关 时间:
2015-02-17 23:36:07
阅读次数:
225
Given an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may assume that the arr...
分类:
其他好文 时间:
2015-02-16 10:13:36
阅读次数:
145
题目:
Given an array of size n, find the majority element. The majority element is the element that appears more than ?
n/2 ? times.
You may assume that the array is non-empty and the majority...
分类:
其他好文 时间:
2015-02-15 09:30:08
阅读次数:
179
Compare two version numbers version1 and version2.
If version1 > version2 return 1, if version1
You may assume that the version strings are non-empty and contain only digits and the . character...
分类:
编程语言 时间:
2015-02-15 09:27:02
阅读次数:
219
Given preorder and inorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
这道题要求根据二叉树的前序遍历序列和中序遍历序列构建二叉树。
举个例子:
前序序列:A B D E F C...
分类:
其他好文 时间:
2015-02-14 13:48:00
阅读次数:
145
Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
这道题与上一题类似, 要求根据二叉树的后序遍历序列和中序遍历序列构建二叉树。后序遍历序列的末尾是根节点,在中...
分类:
其他好文 时间:
2015-02-14 13:47:49
阅读次数:
216
For a given undirected graph with N vertices and E edges, please list all the connected components by both DFS and BFS. Assume that all the vertices a...
分类:
其他好文 时间:
2015-02-12 20:08:39
阅读次数:
145
1 assume cs:code,ds:data,es:table,ss:stack 2 3 data segment 4 db '1975','1976','1977','1978','1979','1980','1981','1982','1983' 5 db '1984',...
分类:
编程语言 时间:
2015-02-11 20:15:37
阅读次数:
157