C++数据结构
文章平均质量分 68
learn123_net
http://learn123.net There are lots of products in the market that make you dazzled and you dont know how to make a choice. In here we introduce the latest fashion and popular treands. Therefore you learn it first,and then buy the goods that you bes
展开
-
C++数据结构--选择排序
#include typedef int InfoType; #define n 5 //假设的文件长度,即待排序的记录数目 typedef int KeyType; //假设的关键字类型 typedef struct { //记录类型 KeyType key; //关键字项 InfoType otherinfo;//其它数据项,类型InfoType依赖于具体应用而定义原创 2013-06-12 11:45:49 · 778 阅读 · 0 评论 -
C++数据结构--冒泡排序
#include typedef int InfoType; typedef enum {FALSE,TRUE} Boolean; #define n 5 //假设的文件长度,即待排序的记录数目 typedef int KeyType;//假设的关键字类型 typedef struct { //记录类型 KeyType key; //关键字项 InfoType otherin原创 2013-06-12 11:06:35 · 710 阅读 · 0 评论 -
C++数据结构--直接插入排序
#include typedef int InfoType; #define n 8 //假设的文件长度,即待排序的记录数目 typedef int KeyType; //假设的关键字类型 typedef struct { //记录类型 KeyType key; //关键字项 InfoType otherinfo;//其它数据项,类型InfoType依赖于具体应用而定义原创 2013-06-12 13:01:01 · 736 阅读 · 0 评论 -
C++数据结构--二叉树的建立,前序遍历,中序遍历和后序遍历
本文所用到的二叉树: #include #include using namespace std; typedef struct BT { char data; //二叉树数据域 BT *Left; //二叉树左节点 BT *right; //二叉树右节点 }BTree; void create(BTree *&head) {原创 2013-06-13 12:25:20 · 1331 阅读 · 0 评论 -
C++数据结构——顺序表
err.h #ifndef _Err_ #define _Err_ #include class OutOfMemory { public: OutOfMemory(){} }; int my_Handler(size_t size) { throw OutOfMemory(); return 0; }; _PNH old_handler=_set_n原创 2013-06-13 16:48:29 · 791 阅读 · 0 评论 -
C++数据结构--二分查找的递归和非递归实现
#include using namespace std; /* *二分查找的非递归实现 *i表示数组开始下标 *j表示数组结束下标 *k表示查找关键字 *m表示数组中间下标 */ int BSort(int arr[],int i,int j,int k) { int m=(i+j)/2; while(i { m=(i+j)/2; if(k==a原创 2013-06-12 23:48:14 · 739 阅读 · 0 评论 -
C++数据结构--快速排序
#include typedef int InfoType; #define n 8 //假设的文件长度,即待排序的记录数目 typedef int KeyType; //假设的关键字类型 typedef struct { //记录类型 KeyType key; //关键字项 InfoType otherinfo;//其它数据项,类型InfoType依赖于具体应用而定义 } Re原创 2013-06-12 18:33:47 · 732 阅读 · 0 评论