資源簡介
采用紅黑樹類的行書,紅黑樹的基本功能操作都有,插入刪除中序遍歷打印,采用菜單式操作。
代碼片段和文件信息
/*
All?rights?reserved
This?program?is?about?the?data?structure?of?RedBlackTree
The?program?include?the?file?:?redblack.h?main.cpp
Abstract?:?It?severs?an?class?named?RBTEE?and?some?interface?about?the?RBTREE:
Initalize?the?RBTREE
Insert?node?to?the?RBTREE
Delete?node?of?the?RBTREE
Print?all?the?node?of?the?RBTREE
The?latest?version?is?:?1.0
Author: Baimen
It?has?been?tested?in?windows?and?Linux.
You?can?compile?it?with?VS2008?or?GCC
In?linux?you?can?compile?it?with?the?command?:?$g++?-o?rbtree?redblackt.h?main.cpp
and?use?is?with?command?$./rbtree
*/
#include?“redblack.h“
int?main?()
{
rbtree?debian; //定義樹
//?采用菜單控制對紅黑樹的操作
string?choice?=?““;
cout<<“\3?0:?Init\t\3?1?:?Insert\t\3?2:?Delpoint\t\3?3:?Print\t\3Q:quit\n“;
cout<<“Please?choose?:?“;
while?(?choice?!=?“Q“){
cin>>
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1838??2008-10-23?23:29??REDBLACkTREE\main.cpp
?????文件??????17131??2008-10-21?14:57??REDBLACkTREE\redblack.h
?????目錄??????????0??2008-10-29?17:40??REDBLACkTREE
-----------?---------??----------?-----??----
????????????????18969????????????????????3
- 上一篇:MFC 自定義消息實現
- 下一篇:CChart開源版本,2013.10.14上傳
評論
共有 條評論