http://poj.org/problem?id=1145
Tree Summing
| Tree Summing |
Background
LISP was one of the earliest high-level programming languages and, with FORTRAN, is one of the oldest languages currently being used. Lists, which are the fundamental data structures in LISP, can easily be adapted to represent other important data structures such as trees.
This problem deals with determining whether binary trees represented as LISP S-expressions possess a certain property.
The Problem
Given a binar
二叉树路径求和

该博客讨论如何解决UVA 112和POJ 1145问题,涉及利用LISP S表达式表示的二叉树,寻找具有特定整数和的根到叶路径。文章介绍了输入输出格式,并提供了样例输入和输出,强调了建树和路径搜索(使用DFS)的难点,特别是处理空格、换行和负权重节点。
最低0.47元/天 解锁文章
440

被折叠的 条评论
为什么被折叠?



