
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 · 804 阅读 · 0 评论 -
C++数据结构--冒泡排序
#includetypedef 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 · 735 阅读 · 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 · 758 阅读 · 0 评论 -
C++数据结构--二叉树的建立,前序遍历,中序遍历和后序遍历
本文所用到的二叉树:#include#includeusing namespace std;typedef struct BT{ char data; //二叉树数据域 BT *Left; //二叉树左节点 BT *right; //二叉树右节点}BTree;void create(BTree *&head){原创 2013-06-13 12:25:20 · 1416 阅读 · 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 · 811 阅读 · 0 评论 -
C++数据结构--二分查找的递归和非递归实现
#includeusing 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 · 766 阅读 · 0 评论 -
C++数据结构--快速排序
#includetypedef int InfoType;#define n 8 //假设的文件长度,即待排序的记录数目typedef int KeyType; //假设的关键字类型typedef struct { //记录类型KeyType key; //关键字项InfoType otherinfo;//其它数据项,类型InfoType依赖于具体应用而定义} Re原创 2013-06-12 18:33:47 · 757 阅读 · 0 评论