⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mtree.cpp

📁 B-树实现索引和快速查找
💻 CPP
字号:
#include"Mtree.H"
#include<stdlib.h>
#include<fstream.h>
void main(){
	Btree<int> a(0);int d=1;int min,max,find;
	ifstream fin("in.txt",ios::in|ios::nocreate);
	if(!fin){cout<<"File cannot be open!"<<endl;exit(1);}
	fin>>a;
	cout<<a;
	cout<<"输入要查找的键值: ";
	cin>>find;
	cout<<a.Find(find)<<endl;
	cout<<"输入要查找的键值范围,最小值Min= ";
	cin>>min;
	cout<<"最大值Max= ";
	cin>>max;
	a.FindRange(min,max);
	cout<<endl;
	while(d){
		cout<<"输入将要删除的键值,并以 0 结束 :";
		cin>>d;
		a.Delete(d);
	    cout<<a;
	}
	fin.close();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -