随笔分类 - buildTree
摘要:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge them into a new binary tre...
阅读全文
摘要:做个test case 看看起始点和终止点的位置, 构造树都不包括遍历过得
阅读全文
摘要:分治法后序遍历建树 对数组, 输入值为数组(起始点和终止点控制数组的长度和节点的值 去掉用过的点的位置) : 1递归出口, if (prestart > preend || instart > inend) return null; 2构造节点, 根据数组的某个位置 3操作数组的长度, 起始点和终止
阅读全文

浙公网安备 33010602011771号