基础算法
God_s_apple
我奔跑,不像无定向的,我斗拳,不是抓空气。
展开
-
快速排序算法源码
//从小到大的顺序 void quicksort(int a[], int left,int right) { int i,j,t,temp; if(left>right) return; temp=a[left]; //temp中存的就是基准数 i=left; j原创 2016-07-08 10:18:15 · 416 阅读 · 0 评论 -
C语言二叉树结构数组法
#include "stdafx.h" struct tree{ int left; int data; int right; }; typedef struct tree treenode; const int num = 32768; treenode tree[num]; int _tmain(int argc, _TCHAR* argv[]) { int n = 9;原创 2016-12-21 19:36:34 · 1334 阅读 · 0 评论 -
c语言构造数组二叉树
#include "stdafx.h" #include #include const int nodecnt = 32768; int tree[nodecnt];//下标从1开始 int _tmain(int argc, _TCHAR* argv[]) { int count = 9; int num[10] = { 6, 3, 8, 5, 2, 9, 4, 7, 10 };;原创 2016-12-20 14:37:19 · 1592 阅读 · 1 评论