摘要:B. Masha and geometric depression time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Masha r
阅读全文
摘要:A. Anastasia and pebbles time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Anastasia loves
阅读全文
摘要:B. Strip time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alexandra has a paper strip with
阅读全文
摘要:C. Berzerk time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output C. Berzerk time limit per tes
阅读全文
摘要:Problem: List likes playing card Time limit: 2s Mem limit: 64 MB Problem Description List's father morejarphone likes playing poker with List very muc
阅读全文
摘要:题目1 : 出勤记录I(水题) 题目1 : 出勤记录I(水题) 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi的算法课老师每次上课都会统计小Hi的出勤记录。迟到会被记录一个L,缺席会被记录一
阅读全文
摘要:已知中序、后序遍历求前序遍历的方法和已知前序、中序遍历求后序遍历的方法类似寻找根节点, 然后把中序遍历分成左右两个子树,有如此不断递归。很多文章介绍,不再累述。
阅读全文
摘要:已知先序和中序遍历序列,求后序遍历序列。 已知该二叉树的先序遍历序列为:A-B-D-E-G-C-F,中序遍历序列为:D-B-G-E-A-C-F。 接下来我们就可以求出该二叉树的后序遍历序列,具体步骤如下: 第一步:先求root根节点,根据先序遍历规则我们可知root为先序遍历序列的第一个节点,因此该
阅读全文
摘要:二叉树的先序遍历顺序为:父亲->左儿子->右儿子 中序遍历顺序为:左儿子->父亲->右儿子 后序遍历顺序为:右儿子->左儿子->父亲
阅读全文