10.4 1 那棵树就长成下面这个样子 ~~~ / 18 12 10 7 4 2 21 5 / ~~~ 下面就借用10.4 1提供的数据,构建一棵树,然后分别对它做10.4 2所要求的递归遍历和10.4 3所要求的非递归遍历。 递归遍历的方式有三种,前序、中序、后序,实现上的差异,无非是把Trave ...
分类:
编程语言 时间:
2018-10-15 20:48:10
阅读次数:
327
【Linux文件】 Linux 系统中一切皆文件。 【Linux目录结构】 --/bin 是Binary的缩写, 这个目录存放着最经常使用的命令。 --/sbin s就是Super User的意思,这里存放的是系统管理员使用的系统管理程序。 --/home 存放普通用户的主目录,在Linux中每个用 ...
分类:
系统相关 时间:
2018-10-15 18:31:19
阅读次数:
184
You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t ...
分类:
其他好文 时间:
2018-10-15 18:16:12
阅读次数:
167
Given the root node of a binary search tree (BST) and a value to be inserted into the tree, insert the value into the BST. Return the root node of the ...
分类:
其他好文 时间:
2018-10-15 12:20:01
阅读次数:
171
Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the given t ...
分类:
其他好文 时间:
2018-10-15 12:04:24
阅读次数:
129
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a ...
分类:
其他好文 时间:
2018-10-15 11:52:49
阅读次数:
128
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe ...
分类:
其他好文 时间:
2018-10-15 11:47:32
阅读次数:
134
1.实践题目 2.问题描述 设a[0:n-1]是已排好序的数组,请改写二分搜索算法,使得当x不在数组中时,返回小于x的最大元素位置i和大于x的最小元素位置j。当搜索元素在数组中时,i和j相同,均为x在数组中的位置。 输入格式: 输入有两行: 第一行是n值和x值; 第二行是n个不相同的整数组成的非降序 ...
分类:
编程语言 时间:
2018-10-14 20:51:03
阅读次数:
165
链接 [http://codeforces.com/contest/1066/problem/E] 题意 给你长度分别为n,m的二进制串,当b 0时,对a,b,&运算,然后b右移一位,把每次a&b的10进制结果累加对 998244353取余 分析 模拟这个过程,但有个技巧就是对b从高位开始求二进制的 ...
分类:
其他好文 时间:
2018-10-14 16:26:01
阅读次数:
103
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a ...
分类:
其他好文 时间:
2018-10-14 14:05:13
阅读次数:
139