码迷,mamicode.com
首页 >  
搜索关键字:list sort    ( 66297个结果
全排列
#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
LeetCode:Rotate List
题目链接Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.首...
分类:其他好文   时间:2014-05-01 04:52:19    阅读次数:288
Reverse Linked List II
链表反转的简单变形。
分类:其他好文   时间:2014-05-01 03:46:43    阅读次数:248
快速排序
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
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
Leetcode:Reorder List 单链表重排序
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example, Given {1,2,3,4}, reorder it to ...
分类:其他好文   时间:2014-04-29 13:42:21    阅读次数:427
struts2 <s: select 标签取值
JSP页面: listValue="name"  key="name"   cssStyle="width:130px"> 后台: private  List navs; navs=navservice.allNav();调用dao层取得所有的值集合。 注: listValue="name"通过设置这个属性显示所有的select内容...
分类:其他好文   时间:2014-04-29 13:32:23    阅读次数:236
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!