
数据结构的研究
对大学数据结构中比较全面的介绍,具体的算法实现,大学计算机考研中重要的数据结构问题的分析
超纯の小白兔
华为云高级工程师
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数据结构之 直接插入排序
#include "stdafx.h"void InsertSort(int R[],int n){ int i,j; int temp; for(i=2;i<=n;i++) { temp=R[i]; j=i-1; while(temp=1) { R[j+1]=R[j]; --j; } R[j+1]=temp;原创 2013-10-10 23:24:41 · 1127 阅读 · 0 评论 -
数据结构之 折半插入排序
//折半插入排序void InsertSort2(int R[],int n){ int i,j,low,mid,hight; for(i=2;i<=n;++i) { R[0]=R[i]; low=1; hight=i-1; while(low<=hight) { mid=(low+hight)/2; if(R[mid]>R[0])原创 2013-10-10 23:46:54 · 1387 阅读 · 0 评论 -
数据结构之 Shell排序
void shellsort(int A[], int n){ int i,j,temp,dk; for(dk=n/2;dk>=1;dk=dk/2) { for(i=dk+1;i<=n;i++) { if(A[i]<A[i-dk]) { temp=A[i]; j=i-dk; while(temp=1) {原创 2013-10-12 23:35:24 · 1435 阅读 · 0 评论 -
数据结构之 队列的操作与实现
// 队列.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "malloc.h"#define maxSize 10//循环队列typedef struct{ int data[maxSize]; int front; int rear;}SqQueue;void initQueue(SqQueue &qu)//初始队原创 2013-09-27 23:49:12 · 1006 阅读 · 0 评论 -
普莱姆最小生成树算法
//普莱姆最小生成树算法void Prim(MGraph g,int v0,int &sum){ int lowcost[maxSize],vset[maxSize],v; int i,j,k,min; v=v0; for(i=1;i { lowcost[i]=g.edges[v0][i]; vset[i]=0; } vset[v0]=1;//并入树原创 2013-10-06 22:54:59 · 2209 阅读 · 0 评论 -
数据结构之 顺序表的实现与操作
#include#define maxSize 100 typedef struct { int data[maxSize]; int length;}Sqlist;void initSqlist(Sqlist &L){ L.length=0;}void ListInsert(Sqlist &L,int locate,int x){ if(L.length==maxSi原创 2013-09-23 12:13:14 · 1479 阅读 · 0 评论 -
数据结构之 链栈的实现
#include "stdafx.h"#include "malloc.h"#define maxSize 100 typedef struct LNode{ int data; struct LNode *next;}LNode;void push(LNode *&L,int x)//使用这个方法 使得栈的入栈和出栈都在表头了{ LNode *p; p=(LNode*)原创 2013-09-27 14:37:24 · 1189 阅读 · 0 评论 -
数据结构之 二叉树的构造与遍历(先序,中序,后序,层次)
// 二叉树.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #define maxSize 10using namespace std;typedef struct BinaryTreeNode{ char data; BinaryTreeNode * leftChild; BinaryTreeNode原创 2013-09-30 12:46:28 · 6796 阅读 · 0 评论 -
数据结构之 图的存储结构和遍历方式
// 图.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "malloc.h"#define maxSize 100 typedef struct ArcNode{ int adjvex; struct ArcNode *nextNode; int info;}ArcNode;typedef struct VNode原创 2013-10-03 00:01:18 · 4224 阅读 · 1 评论 -
数据结构之 迪杰斯特拉最短路径算法
void printfPath(int path[],int a){ int statck[maxSize],top=-1; while(path[a]!=-1) { statck[++top]=a; a=path[a]; } statck[++top]=a; while(top!=-1) { cout<<statck[top--]<<" ";原创 2013-10-07 12:43:37 · 1323 阅读 · 0 评论