码迷,mamicode.com
首页 >  
搜索关键字:topological sort    ( 12965个结果
hdu acm 1425 sort(哈希表思想)
sortTime Limit: 6000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25803Accepted Submission(s): 7764Problem Descr...
分类:其他好文   时间:2014-05-01 20:50:16    阅读次数:583
全排列
#include#include#includeusing namespace std;int main(){ int n,i; char a[100000]; cin>>a; sort(a,a+strlen(a)); do{ cout<<a<<endl; }while(next_permut...
分类:其他好文   时间:2014-05-01 06:20:37    阅读次数:368
c++ ACM常用函数
1 保留小数点后两位#include cout const char * spilt="/";char *p;p=strtok(str,spilt);while(p!=NULL){ //cout #includesort(Rs.begin(),Rs.end());sort(Rs.begin(),Rs...
分类:编程语言   时间:2014-05-01 05:05:45    阅读次数:409
快速排序
package algorithm.sort;public class QuickSort { public static void main(String[] args) { int[] a = new int[] {5, 3, 7, 2, 1, 4, 9, 8, 6, 1}; sort(a); ...
分类:其他好文   时间:2014-05-01 03:33:20    阅读次数:330
计数排序
package algorithm.sort;public class CountingSort { public static void main(String[] args) { int[] a = new int[] {5, 3, 7, 2, 1, 4, 9, 8, 6, 1}; int[] ...
分类:其他好文   时间:2014-05-01 03:25:05    阅读次数:252
堆排序
package algorithm.sort;public class HeapSort { public static void main(String[] args) { int[] a = new int[] {5, 3, 7, 2, 1, 4, 9, 8, 6, 1}; sort(a); p...
分类:其他好文   时间:2014-05-01 03:24:04    阅读次数:332
Sort Colors
leetcode,三色排序...
分类:其他好文   时间:2014-04-30 22:14:39    阅读次数:225
stable_sort() 和 sort() 的区别
1.stable_sort 和 sort的区别在于 前者作排序可以使原来的"相同"的值在序列中的相对位置不变 如 1 4 6 7 4' (4 和 4'值相等,加上' 表示是2个元素) 那么stable_sort能保证排序完 4 仍然在4' 前 也就是输出1 4 4' 6 7;但是sort 没有这个功能,算法不能保证这一点 2.在标准算法中的一部分算法 如果这个算法默认使用的是 ...
分类:其他好文   时间:2014-04-29 13:45:20    阅读次数:273
排序算法-冒泡——插入——快排
冒泡排序,往两个方向泡,一个往小泡,一个网大泡 #include #include #include void bubble_sort(int *a,int n){ int temp; for(int i=0;i<n;i++) for(int j=0;ja[j+1]){ temp=a[j]; a[j]=a[j+1]; ...
分类:其他好文   时间:2014-04-29 13:28:21    阅读次数:364
数组,vector的sort快速降序方法
在sort中因为默认是升序的,所以一般我们需要降序的时候就……了。 以前我在CF上看到有人用sort的数组降序方法,快速简单,然后刚才写425A - Sereja and Swaps题的时候又看到别人vector的降序方法,以前学习的时候怎么不知道呢,哈哈……虽然CF没多大建树,不过确实看到好多大神的编程方法以及优化方法,实在是很有用啊! 很多时候不是我们不懂,而是我们不会优化,对系统的函数用...
分类:其他好文   时间:2014-04-29 13:16:21    阅读次数:322
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!