摘要:
// 算法.cpp : 定义控制台应用程序的入口点。//对于堆排序来说,逻辑上是树的形式,实际存储的形式还是数组。只是对下标进行一定的计算获得逻辑上树的形式。//此堆的结构为0号位为根结点,没有左子树,右边接着以1号位置为根结点的子树。#include "stdafx.h"#include <iostream>using namespace std;const int HEAP_SIZE = 13; //堆大小int parent(int);int left(int);int right(int);void Max_Heapify(int [], int, in 阅读全文
posted @ 2012-03-03 11:48
java简单例子
阅读(187)
评论(0)
推荐(0)
摘要:
// 算法.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include <iostream>#include <ctime>using namespace std;void QuickSort(int e[], int first, int end);int _tmain(int argc, _TCHAR* argv[]){ srand(unsigned(time(NULL)));//set 种子 int t_nArray[10]; //产生随即数组 for(int i = 0; i < 10; i++) 阅读全文
posted @ 2012-03-03 10:32
java简单例子
阅读(270)
评论(0)
推荐(0)
浙公网安备 33010602011771号