infix.cpp
来自「data struct algorithm and application in」· C++ 代码 · 共 26 行
CPP
26 行
// generate infix from expression tree
#include <iostream.h>
template <class type>
class BinaryTreeNode {
friend void Infix(BinaryTreeNode<type>*);
friend void main(void);
private:
type data;
BinaryTreeNode *LeftChild, *RightChild;
};
#include "infix.h"
void main(void)
{
BinaryTreeNode<int> x,y,z;
x.data = 1; y.data = 2; z.data = 3;
x.LeftChild = &y; x.RightChild = &z;
y.LeftChild = y.RightChild = z.LeftChild = z.RightChild = 0;
Infix(&x);
cout << endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?