#include #include using namespace std;typedef struct Node{ Node* lchild; Node* rchild; int data;}BNode,BTree;void visit(Node*);void inorder(B...
分类:
其他好文 时间:
2014-07-19 19:26:40
阅读次数:
226
class Solution {public: TreeNode *buildTree(vector &preorder, vector &inorder) { int plen = preorder.size(); int ilen = inorder.size(...
分类:
其他好文 时间:
2014-07-16 18:41:43
阅读次数:
182
class Solution {public: TreeNode *buildTree(vector &inorder, vector &postorder) { int ilen = inorder.size(); int plen = postorder.siz...
分类:
其他好文 时间:
2014-07-16 18:23:21
阅读次数:
155
[LeetCode]Binary Tree Inorder Traversal...
分类:
其他好文 时间:
2014-07-14 16:10:00
阅读次数:
193
Implement a function to check if a binary tree is a binary search tree./* The inorder travel of a BST is strictly increasing. We track the pre node of...
分类:
其他好文 时间:
2014-07-13 22:27:09
阅读次数:
344
题目:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.说明: 1)二叉树可.....
分类:
其他好文 时间:
2014-07-11 21:07:27
阅读次数:
273
题目:Given inorder and postorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.说明: 1)实现与.....
分类:
其他好文 时间:
2014-07-11 20:40:38
阅读次数:
198
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.思路:递归。主要是注意调用时起...
分类:
其他好文 时间:
2014-07-10 14:40:07
阅读次数:
196
class BTNode:
def __init__(self, val):
self.left = None
self.right = None
self.val = val
'''
@ construct tree by inorder & preorder
'''
def constructByInPre(inorder, instart, inend, preorde...
分类:
其他好文 时间:
2014-07-06 00:34:00
阅读次数:
234
Given inorder and postorder traversal of a tree, construct the binary tree.
分类:
其他好文 时间:
2014-07-03 19:13:08
阅读次数:
187