其他语言

本类阅读TOP10

·基于Solaris 开发环境的整体构思
·使用AutoMake轻松生成Makefile
·BCB数据库图像保存技术
·GNU中的Makefile
·射频芯片nRF401天线设计的分析
·iframe 的自适应高度
·BCB之Socket通信
·软件企业如何实施CMM
·入门系列--OpenGL最简单的入门
·WIN95中日志钩子(JournalRecord Hook)的使用

分类导航
VC语言Delphi
VB语言ASP
PerlJava
Script数据库
其他语言游戏开发
文件格式网站制作
软件工程.NET开发
排序算法功能函数 Compositor.cpp

作者:未知 来源:月光软件站 加入时间:2005-2-28 月光软件站

///////////////////////////
//    //
//  排序算法功能函数    Compositor.cpp //
//    //
//////////////////////////



#include"Compositor.h"


const int INT =13;
const double FLOAT= 13.33;
const char CHAR ='a';

template<class type>
void CompositorINI(type temp)
{
Compositor<type> CompositorOPP;

do
{
cout<<"排序的操作: "<<endl
<<" 1) 插入排序"<<endl
<<" 2) 快速排序"<<endl
<<" 3) 归并排序"<<endl
<<" 4) 冒泡排序"<<endl
<<" 5) 选择排序"<<endl
<<" X) 退出排序操作"<<endl
<<"请选择相应的操作: ";
int item;
cin>>item;
switch(item)
{
case 1: Compositor_Insert(CompositorOPP); break;
case 2: Compositor_Quick(CompositorOPP);  break;
case 3: Compositor_Merge(CompositorOPP);  break;
case 4: Compositor_Bubble(CompositorOPP); break;
case 5: Compositor_Select(CompositorOPP); break;

default: return ;
}

}while(true);


}

void COMPOSITOR()//根据不同的用户需要选择数据类型
{
int item;
cout<<"清选择数据类型: 1) 整型 2) 浮点型 3) 字符型 X) 退出: ";


cin>>item;
switch(item)
{
case 1: CompositorINI(INT); break;   
case 2: CompositorINI(FLOAT); break;
case 3: CompositorINI(CHAR); break;
  default: return ; break;
}
}

template<class type>
void Compositor_Insert(Compositor<type> CompositorOPP)
{
CompositorOPP.Insert();
}

template<class type>
void Compositor_Quick(Compositor<type> CompositorOPP)
{
CompositorOPP.Quick();
}

template<class type>
void Compositor_Select(Compositor<type> CompositorOPP)
{
CompositorOPP.Select();
}

template<class type>
void Compositor_Merge(Compositor<type> CompositorOPP)
{
CompositorOPP.MergeSort();
}


template<class type>
void Compositor_Bubble(Compositor<type> CompositorOPP)
{
CompositorOPP.Bubble();
}



相关文章

相关软件