码迷,mamicode.com
首页 >  
搜索关键字:sort    ( 12890个结果
uva 331 Mapping the Swaps (回溯)
uva 331 Mapping the Swaps Sorting an array can be done by swapping certain pairs of adjacent entries in the array. This is the fundamental technique used in the well-known bubble sort. If we li...
分类:移动开发   时间:2015-02-02 18:07:12    阅读次数:179
*查看进程所消耗的内存*
转#!/bin/sh mem=`free -m | awk 'NR==2{print $2}'` ps aux | sort -k 4 -r | awk '$4 ~ /^[0-9]/ && $4>0 {print $4,$11}' | awk '{print $1/100*mem" "$2}' me...
分类:系统相关   时间:2015-02-02 15:40:23    阅读次数:174
桶排序
1 #include 2 #include 3 4 int a[10010],w[10010],p[10010],o[10010]; 5 6 void Barrel_Sort(int *a,int n,int mx) 7 { 8 int i; 9 memset(w,0,size...
分类:编程语言   时间:2015-02-02 12:31:22    阅读次数:210
集合框架1.7之Collections静态工具类
Collections类提供了一些列静态的方法,用以更方便地操作集合类 排序机制 一个List可以通过下面的方法进行排序: Collections.sort(list); 如果List包含的是字符串,将会按照字母表排序;如果List包含的是Date类型数据,会按照日期先后排序……这是怎么实现的呢?String和Date都实现了comparable接口,此接口强行对实现它的每个类的对象进行整...
分类:其他好文   时间:2015-02-01 10:51:59    阅读次数:173
Sort Colors
题目: Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the ...
分类:其他好文   时间:2015-01-31 12:46:38    阅读次数:131
《算法导论》Problem 2-4 Inversions
在Merge Sort的基础上改改就好了。 1 public class Inversions { 2 3 public static int inversions(int [] A,int p, int r) 4 { 5 6 if(...
分类:编程语言   时间:2015-01-30 19:31:20    阅读次数:141
查看服务器IP连接数之主要命令(在服务器受攻击时用)
查看TCP几种状态的总数netstat -n | awk '/^tcp/ {++S[$NF]} END {fo (a in S). print a, S[a]}'按IP查看连接数排序netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq...
分类:其他好文   时间:2015-01-30 15:00:16    阅读次数:184
用委托定义的冒泡排序法
1.排序的类public class BubbleSorter { static public void Sort(IList sortArray, Func comparison) { bool swapped = true; do { ...
分类:编程语言   时间:2015-01-30 14:30:03    阅读次数:116
LeetCode-Sort Colors
题目链接:https://oj.leetcode.com/problems/sort-colors/ 题目: Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the or...
分类:其他好文   时间:2015-01-30 09:07:20    阅读次数:236
Sort Colors
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/43302343 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue....
分类:其他好文   时间:2015-01-30 09:04:36    阅读次数:140
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!