sailing

Everything...

01 2007 档案

Merge Sort
摘要:// MergeSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include void MergeSort(int* a, int iLen); void MergePass(int* a, int* aa, int subLength, int iLen);... 阅读全文

posted @ 2007-01-29 01:11 乌生鱼汤 阅读(210) 评论(0) 推荐(0)

Heap Sort
摘要:// HeapSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include void DirectSelectSort(int* a, int iLen); void HeapSort(int* a, int iLen); void FilterDown(in... 阅读全文

posted @ 2007-01-29 00:10 乌生鱼汤 阅读(207) 评论(0) 推荐(0)

Direct Selection Sort
摘要:#include "stdafx.h" #include void DirectSelectSort(int* a, int iLen); void Swap(int* a, int index1, int index2); void PrintArray(int a[], int iLen); int _tmain(int argc, _TCHAR* argv[]) { int... 阅读全文

posted @ 2007-01-28 23:10 乌生鱼汤 阅读(208) 评论(0) 推荐(0)

Quick sort
摘要:// QuickSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include void QuickSortStart(int* a, int iLen); void QuickSort(int* a, int startIndex, int endIndex)... 阅读全文

posted @ 2007-01-28 22:56 乌生鱼汤 阅读(198) 评论(0) 推荐(0)

bubble sort
摘要:// BubbleSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include void BubbleSort(int* a, int iLen); void PrintArray(int a[], int iLen); int _tmain(int ar... 阅读全文

posted @ 2007-01-28 21:29 乌生鱼汤 阅读(146) 评论(0) 推荐(0)

shell sort
摘要:// ShellSort.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include void ShellSort(int* a, int iLen); void PrintArray(int a[], int iLen); int _tmain(int argc... 阅读全文

posted @ 2007-01-28 21:11 乌生鱼汤 阅读(277) 评论(0) 推荐(0)

直接插入排序 direct insertion sort
摘要:#include "stdafx.h" #include #include "stdio.h" void DirectInsertSort(int a[], int iLen); void PrintArray(int a[], int iLen); int _tmain(int argc, _TCHAR* argv[]) { // the first element of th... 阅读全文

posted @ 2007-01-28 20:12 乌生鱼汤 阅读(200) 评论(0) 推荐(0)

c++解决汉诺塔,显示每一步的碟子情况 C++ hanoi with trace of every step
摘要:#include "stdafx.h" #include #include void StartHanoi(int n); void Hanoi(int length, std::stack* source, std::stack* middle, std::stack* destination); void PrintStack(); void PrintAStack(std... 阅读全文

posted @ 2007-01-28 18:47 乌生鱼汤 阅读(574) 评论(0) 推荐(0)

remove duplicate element in an array
摘要:demonstrates an O(n2) method to remove the duplicated elements in an array// caution: 1. don't try to return int[] array from a function, c++ doesn't support this, though c# does it well.// ... 阅读全文

posted @ 2007-01-20 22:48 乌生鱼汤 阅读(385) 评论(0) 推荐(0)

导航