package com.tree.demo;public class BinaryTree { int data; // 根节点数据 BinaryTree left; // 左子树BinaryTree right; // 右子树 public BinaryTree(int data) // 实例化....
分类:
编程语言 时间:
2014-07-19 19:06:23
阅读次数:
196
1. Cap'n Protoprotocol buffer的主要作者之一创建的新项目。其主页描述Cap'n Proto的性能比PB快很多。http://kentonv.github.io/capnproto/index.html2. FlatBufferFlatBuffers is a serial...
分类:
其他好文 时间:
2014-07-19 00:28:17
阅读次数:
291
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2014-07-19 00:24:36
阅读次数:
170
在index.php的第97和98行的注释, // The directory name, relative to the "controllers" folder. Leave blank // if your controller is not in a sub-folder within t....
分类:
其他好文 时间:
2014-07-19 00:18:35
阅读次数:
212
Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which rep...
分类:
其他好文 时间:
2014-07-18 20:09:38
阅读次数:
433
A simple 1D searching problem. Binary search of course.But.. STL has already done it for you:class Solution {public: int searchInsert(int A[], int ...
分类:
其他好文 时间:
2014-07-18 18:35:41
阅读次数:
205
binarySearch原理: public static index halfSearch(List list, String key) { int max,min,mid; max = list.size()-1; min = 0; while(min>1; String str = list....
分类:
其他好文 时间:
2014-07-18 18:32:20
阅读次数:
238
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-07-18 18:28:44
阅读次数:
231
题目:应用递归,将输入的二进制数转换为十进制。#include #include void binary_to_decimal(char *s, long dec){ if( *s == '\0' ) printf("Decimal: %ld\n",dec); else ...
分类:
其他好文 时间:
2014-07-18 18:23:50
阅读次数:
217
Another recursion-style problem.1. Each count of sub-solution with a certain root should contribute to final count2. With a certain root, the num of l...
分类:
其他好文 时间:
2014-07-18 18:18:01
阅读次数:
187