lxbinnode.cpp
来自「vc编写的数据结构」· C++ 代码 · 共 72 行
CPP
72 行
// lxbinnode.cpp: implementation of the lxbinnode class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "lxbinnode.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
lxbinnode::lxbinnode()
{
lc=rc=NULL;
}
lxbinnode::~lxbinnode()
{
}
lxbinnode::lxbinnode(int e, lxbinnode *l, lxbinnode *r)
{
it=e;
lc=l;
rc = r;
}
int& lxbinnode::val()
{
return it;
}
void lxbinnode::setval(const int &e)
{
it=e;
}
lxbinnode* lxbinnode::left() const
{
return lc;
}
void lxbinnode::setleft(lxbinnode *b)
{
lc=b;
}
lxbinnode* lxbinnode::right() const
{
return rc;
}
void lxbinnode::setright(lxbinnode *b)
{
rc=b;
}
bool lxbinnode::isleaf()
{
return (lc==NULL)&&(rc==NULL);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?