码迷,mamicode.com
首页 >  
搜索关键字:awk sort    ( 17174个结果
LeetCode: Sort Colors [075]
【题目】 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 integers 0, 1, and 2 to represent the color red, white, and...
分类:其他好文   时间:2014-06-07 01:17:49    阅读次数:269
排序算法之冒泡排序
冒泡排序法是一种经典的、入门级的排序算法。它重复地遍历整个数组,对数组的元素进行两两比较,如果两数的顺序有误,则将两数字交换。 由于在比较的过程中,最小的数先变换到数列的顶端,其次是第二小的数……直至所有数字完成排序,因而得名冒泡排序。...
分类:其他好文   时间:2014-06-05 11:39:09    阅读次数:194
HDU 1890 Robotic Sort 伸展树的区间反转与延迟标记
延迟标记像极了线段书,不再多说。 区间反转在树伸展到位之后,也变成了简单的递归交换左右儿子。 愈发感觉到伸展树简直太漂亮了,伸展操作更是诱惑到不行 ,总之数据结构太有魅力了。 比较简单,就直接上模板了。 #include #include #include #include #include #include #include #include #include #pr...
分类:其他好文   时间:2014-06-05 08:33:14    阅读次数:190
笔试算法题(54):快速排序实现之单向扫描、双向扫描(single-direction scanning, bidirectional scanning of Quick Sort)
议题:快速排序实现之一(单向遍历)分析:算法原理:主要由两部分组成,一部分是递归部分QuickSort,它将调用partition进行划分,并取得划分元素P,然后分别对P之前的部分和P 之后的部分递归调用QuickSort;另一部分是partition,选取划分元素P(随机选取数组中的一个元素,交换...
分类:其他好文   时间:2014-06-03 10:00:23    阅读次数:392
笔试算法题(55):快速排序实现之非递归实现,最小k值选择(non-recursive version, Minimal Kth Selection of Quick Sort)
议题:快速排序实现之五(非递归实现,短序列优先处理,减少递归栈大小)分析:算法原理:此算法实现适用于系统栈空间不足够快速排序递归调用的需求,从而使用非递归实现快速排序算法;使用显示下推栈存储快速排序中的每一次划分结果 (将left和right都压入堆栈),并且首先处理划分序列较短的子序列(也就是在得...
分类:其他好文   时间:2014-06-03 08:23:29    阅读次数:367
63.如何对单链表进行快排?和数组快排的分析与对比[quicksort of array and linked list]
quick sort of array and linked list
分类:其他好文   时间:2014-06-03 08:16:22    阅读次数:359
linux 查看占用内存/CPU最多的进程
可以使用一下命令查使用内存最多的5个进程ps -aux | sort -k4nr | head -n 5或者top (然后按下M,注意大写)可以使用一下命令查使用CPU最多的5个进程ps -aux | sort -k3nr | head -n 5或者top (然后按下P,注意大写)
分类:系统相关   时间:2014-06-03 07:30:14    阅读次数:301
linux awk命令详解【转载】
本文转载自:http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858470.html简介awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大。简单来说awk就是把文件逐行的读入,以空...
分类:系统相关   时间:2014-05-31 11:39:49    阅读次数:543
CodeForces 432C Prime Swaps
DescriptionYou have an arraya[1],?a[2],?...,?a[n], containing distinct integers from1ton. Your task is to sort this array in increasing order with the...
分类:其他好文   时间:2014-05-31 01:35:23    阅读次数:318
Insertion Sort List
Sort a linked list using insertion sort./** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNo...
分类:其他好文   时间:2014-05-30 15:14:27    阅读次数:245
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!