![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
我不是90斤
这个作者很懒,什么都没留下…
展开
-
反转链表
#include "stdafx.h"#include typedef struct Node { int value; Node *next;}LinkNode,*LinkList;//创建链表LinkList createList(){ LinkList head = NULL; LinkNode *prelink = head; for (int i = 0;i < 6原创 2017-04-12 10:07:34 · 249 阅读 · 0 评论 -
二维数组的列交换
#include "stdafx.h"int main(){ int a[3][4] = { {1,2,3,10},{4,5,6,11},{7,8,9,12} }; for (int i = 0;i < 3;i++) { for (int j = 0;j < 4;j++) { printf("%d ", a[i][j]); } printf("\n"); }原创 2017-04-12 20:30:32 · 1853 阅读 · 0 评论 -
单次排序
#include "stdafx.h"int main(){ int a[6] = {5,2,7,6,3,1}; int temp = 5; int p=0, q=5; while (p != q)//一右一左 { while (a[q] > temp && p!=q) //p!=q是为了不让p,q错过 q--; a[p] = a[q]; while (a[原创 2017-04-14 13:37:49 · 214 阅读 · 0 评论 -
快速排序
#include "stdafx.h"#include #include #include using namespace std;int RandomInRange(int start,int end) { return start+rand() % (end - start + 1); //x+rand()%(y-x+1)}int Portion(int data[],i原创 2017-04-16 22:08:05 · 211 阅读 · 0 评论