- 博客(7)
- 资源 (16)
- 收藏
- 关注
原创 Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. struct Node { int val; Node(int v) { val = v; le
2017-01-31 23:09:58 184
原创 找出最大序列对
对于一个数组,找出这样一个序列对(i, j),满足A[i] struct Node { int val; int index; Node(int v, int i) { val = v; index = i; left = right = NULL; } Node *left; Node *right; }; int visit(Node **buf, int n,
2017-01-31 11:56:31 212
原创 Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1
2017-01-30 23:36:06 135
原创 Validate Binary Search Tree
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 nodes with keys less than the node's key.Th
2017-01-29 23:16:54 110
原创 打印最长序列
1. A 2. Ctrl+A 3. Ctrl+C 4. Ctrl+V If you can only press the keyboard for N times (with the above four keys), please write a program to produce maximum numbers of A. If possible, please also pri
2017-01-21 22:22:32 143
原创 打印所有的Binary Number
If the Fibonacci series is 1,2,3,5,8,13,….. then 10 can be written as 8 + 2 ==> 10010 and 17 can be written as 13 + 3 + 1 ==> 100101. Got it?? The Question was, given n, I need to get all possible rep
2017-01-21 21:30:01 225
原创 K上升序列总和
Given an array of integers, find out number of ways in which you can select increasing subsequences of length k(k for eg array is 1 4 6 2 5 & k=3 then the answer is :1 4 5, 1 2 5,1 4 6, so ways a
2017-01-21 15:01:54 310
exceptional c++ style中文版 pdf 刘未鹏译
2010-09-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人