- 博客(3)
- 资源 (4)
- 收藏
- 关注
原创 排序算法(冒泡、选择、插入、快速)
需要注意的问题:在QuickSort中,两个while的顺序不能放反了;#include <iostream>using namespace std;void swap(int &a,int &b ) { int t=a; a=b; b=t;}void BubbleSort(int A[], int n); //冒泡排序void SelectSort(...
2016-11-13 18:39:13 340
原创 二叉树的创建、层次遍历、递归遍历、非递归遍历
在层次遍历中使用的队列文件如下:头文件://Queue.h#pragma once#ifndef NOD_H_#define NOD_H_struct tree_node{ int data; tree_node *lchild, *rchild;};#endifstruct queue_node{ tree_node * data; queue_node *next
2016-11-09 20:47:05 412
原创 图的拓扑排序
#include #include #define NUM 20 //最大顶点数using namespace std;struct EdgeNode //边节点{ int index; //指向定点的索引 EdgeNode *next; };struct VertexNode //顶点结构{ int indegree; //入度 char name[10];
2016-11-09 20:39:37 395
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人