#include "树类.h"
#include <windows.h>
/*
a
/|\
/ | \
/ | \
/ | \
/ | \
/ | \
/ | \
/ | \
b c d
/ \ | /|\
/ \ | / | \
/ \ | / | \
e f g h i j
/ \ |
k l m
*/
struct ABCD
{
int x,y,z;
operator int()//该结构的权值
{
return (x+y+z)/3;
}
};
ostream & operator << (ostream & ost,const ABCD & abc)//显示结构的方法
{
ost<<abc.x<<","<<abc.y<<","<<abc.z;
return ost;
}
void main()
{
ABCD abc0={3,3,3};
ABCD abc1={3,5,1};
ABCD abc2={1,2,4};
Tree<ABCD> tt(abc0);
tt.AddChildren(0,abc1);
tt.AddChildren(0,abc2);
tt.PaintDataTree();
tt.ShowTreeInfo();
Tree<char> t('A');
t.AddChildren('A','B');
t.AddChildren('A','C');
t.AddChildren('A','D');
t.AddChildren('B','E');
t.AddChildren('B','F');
t.AddChildren('C','G');
t.AddChildren('D','H');
t.AddChildren('D','I');
t.AddChildren('D','J');
t.AddChildren('F','K');
t.AddChildren('F','L');
t.AddChildren('J','M');
t.PaintDataTree();
int a=t.FindIndex('F');
t.DeleteNode(a);
t.PaintDataTree();
t.ShowTreeInfo();
cout<<"sizeof(BITMAPFILEHEADER)="<<sizeof(BITMAPFILEHEADER)<<endl;
cout<<"sizeof(BITMAPINFOHEADER)="<<sizeof(BITMAPINFOHEADER)<<endl;
cout<<"sizeof(DWORD)="<<sizeof(DWORD)<<endl;
cout<<"sizeof(WORD)="<<sizeof(WORD)<<endl;
cout<<"sizeof(UINT)="<<sizeof(UINT)<<endl;
cout<<"sizeof(ABCD)="<<sizeof(ABCD)<<endl;
}