题解列表

筛选

二叉树遍历-题解(C++代码)

常规做法,先通过先序遍历和中序遍历构造二叉树,再输出后序遍历序列```cpp#include#includeusingnamespacestd;structnode{chardata;structnode*lchild;structnode*rchild;};node*create(stringpre

汽水瓶-题解(C语言代码)

思路大家讲的都挺明白,大家可以借鉴别人的思路,我就写一下比较容易看懂的算法吧。**方法一:(C++编写)**```cpp#includeintmain(){intn,sum=0;while(std::cin>>n){if(n!=0)while(1){if(n>=3){intj=n/3;intk=n%3