2012年6月4日

摘要: View Code #include <stdio.h>#include <string.h>int parent(int i);int left(int i);int right(int i);void max_heapify(int A[],int i);void bulid_max_heap(int A[]);void heapSort(int A[]);int heapSize=0;int parent(int i){ return i/2;}int left(int i){ return i*2;}int right(int i){ return i*2+1; 阅读全文
posted @ 2012-06-04 14:26 蓝色守望 阅读(122) 评论(0) 推荐(0)
摘要: View Code #include <stdio.h>void merge(int A[],int tmp[],int left,int right,int end);void mergeSort(int A[],int tmp[],int begin,int end);void mergeSort(int A[],int tmp[],int begin,int end){ if((end-begin)>0){ int mid=begin+(end-begin)/2; mergeSort(A,tmp,begin,mid); mergeSort(... 阅读全文
posted @ 2012-06-04 08:57 蓝色守望 阅读(150) 评论(0) 推荐(0)

导航