在这篇文章中。我会向大家展示一些排序算法的可视化过程。我还写了一个工具。大家可对照查看某两种排序算法。下载源代码 – 75.7 KB下载演示样例 – 27.1 KB引言首先,我觉得是最重要的是要理解什么是“排序算法”。依据维基百科。排序算法(Sorting algorithm)是一种能将一串数据按照...
分类:
编程语言 时间:
2016-01-26 21:41:50
阅读次数:
1711
Given an unsorted array arr[0..n-1] of size n, find the minimum length subarray arr[s..e] such that sorting this subarray makes the whole array sorted...
分类:
其他好文 时间:
2016-01-25 13:08:35
阅读次数:
212
排序是一种很频繁的计算任务。现在考虑最多只有三值的排序问题。一个实际的例子是,当我们给某项竞赛的优胜者按金银铜牌序的时候。 在这个任务中可能的值只有三种1,2和3。我们用交换的方法把他排成升序的。 写一个程序计算出,给定的一个1,2,3组成的数字序列,排成升序所需的最少交换次数。本以为又是什么高端的...
分类:
其他好文 时间:
2016-01-24 15:31:24
阅读次数:
154
Given a sorting order string, sort the input string based on the given sorting order string. Ex sorting order string -> dfbcae Input string -> abcdeea...
分类:
其他好文 时间:
2016-01-18 13:48:03
阅读次数:
175
排序集锦各种排序算法,总结一下,一直在遗忘......【冒泡排序】就是下面这个鬼啦:c实现代码(升序):#includevoid BubbleSort(int *array,int num){ int i,j,temp; for(j=0;jarray[i]) //倒序就把...
分类:
其他好文 时间:
2016-01-02 07:00:47
阅读次数:
178
Cow SortingTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2239Accepted Submission(s): 711Problem ...
分类:
编程语言 时间:
2016-01-01 20:50:03
阅读次数:
197
拓扑排序和机智的判环判合法。如果每次入队的点大于1个即为有多个拓扑序。如果该次没有点入队就是环。没时间写代码了,粘的题解。#include#includeint map[27][27],indegree[27],q[27];int TopoSort(int n){ int c=0,temp[2...
分类:
其他好文 时间:
2015-12-21 23:45:54
阅读次数:
187
Sorting the TombstonesTime Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeURAL 1252DescriptionThere is time to throw...
分类:
其他好文 时间:
2015-12-18 18:01:08
阅读次数:
247
/*拓扑序列变形之poj1094SortingItAllOut 变形: 在每消去唯一一个入度为0的点后,只剩下唯一一个入度为0的点。 这样获得的n个点才是排序好的。*/ 1 #include 2 #include 3 #include 4 #include 5 #include ...
分类:
其他好文 时间:
2015-12-18 06:54:35
阅读次数:
231
题意:给你一串数,没个数只能往前提到首位,或则往后放末尾。问最少步骤使操作后的序列成上升序列。思路:最长连续子序列。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 const int N ...
分类:
其他好文 时间:
2015-12-11 15:05:53
阅读次数:
143