数据结构
shenlanlan2
这个作者很懒,什么都没留下…
展开
-
c++顺序栈的实现
#include #include #include #include #define Status int #define STACK_INIT_SIZE 100 #define ERROR 0 #define OK 1 #define TRUE 1 #define FALSE 0 typedef struct{ int *base,*top; int stackSize; }Stac原创 2015-04-23 11:24:47 · 372 阅读 · 0 评论 -
选择排序与冒泡排序
/* * 选择排序,每次从数组中选择一个最小的插入到有序部分, * 数组可分为两部分,前面的有序部分,后面乱序 * 时间复杂度O(n*n) * 不稳定的排序算法。 */ public class SelectSort { static void selectSort(int a[]){ for(int i=0;i<a.length-1;i++){ //每次循环只进行原创 2015-09-12 23:58:40 · 228 阅读 · 0 评论