码迷,mamicode.com
首页 >  
搜索关键字:awk sort    ( 17174个结果)
LeetCode - Sort List
就是用List来实现merge sort. import java.io.*; import java.util.*; class ListNode { int val; ListNode next; ListNode(int x) { val = x; next = null; } s...
分类:其他好文   时间:2014-10-07 12:48:03    阅读次数:172
[zz]jq简介
JSON是前端编程经常用到的格式,对于PHP或者Python,解析JSON都不是什么大事,尤其是PHP的json_encode和json_decode,干的相当的漂亮。Linux下也有处理处理JSON的神器:jq。 对于JSON格式而言,jq就像sed/awk/grep这些神器一样的方便,而也,jq...
分类:其他好文   时间:2014-10-07 08:24:53    阅读次数:355
nyoj 322 Sort 【树状数组】
这道题其实就是考试树状数组。 代码: #include #include int c[1005]; int lowbit(int x){ return x&(-x); } int getsum(int x){ int sum = 0; while(x){ sum += c[x]; x -= lowbit(x); } return sum; } void add(int ...
分类:其他好文   时间:2014-10-06 22:17:02    阅读次数:123
三分归并排序
一直以来做题目用的都是sort函数,突然要自己写归并算法确实挺头痛的。尤其是一开始连归并排序是什么都搞不懂,最后看了半天书终于明白二分归并,那么三分的也就呼之欲出了 1 #include 2 #include 3 #include 4 using namespace std; 5 ...
分类:其他好文   时间:2014-10-06 21:58:40    阅读次数:310
lua的table库中常用的函数
lua提供了一些辅助函数来操作table。例如,从list中insert和remove元素,对array的元素进行sort,或者concatenate数组中的所有strings。下面就详细地讲解这些方法。 insert and remove table.insert将一个元素插入到指定位置,例如: t = {1, 2, 3} table.insert(t, 1, 4} t的结果将...
分类:其他好文   时间:2014-10-06 18:25:10    阅读次数:211
LeetCode Sort Colors
Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, .....
分类:其他好文   时间:2014-10-06 15:15:50    阅读次数:146
数据结构之------C++指针冒泡排序算法
C++通过指针实现一位数组的冒泡排序算法。冒泡排序冒泡排序(Bubble Sort),是一种计算机科学领域的较简单的排序算法。代码: 1 /* 2 Name:冒泡排序算法 3 Copyright:Null 4 Author:小X 5 Date: 06-10-14 10...
分类:编程语言   时间:2014-10-06 12:34:20    阅读次数:216
Sort 对下标进行排序
很久之前看到了 lrj用到了这个技巧,今天才来验证了一下 , b为下表,在保证 a数组不变的额情况下知道 a数组的顺序。代码如下#include #include #include #include #include #include #include #include #include #incl...
分类:其他好文   时间:2014-10-06 01:07:09    阅读次数:196
拓扑排序
拓扑排序要用list,不能用vector,确保删除边的开销为O(1)。因为主循环中,总共要从队列中pop掉n个数(点),然后总共要删e条边,删点和边的开销都是O(1)。所以整个时间复杂度就是O(n+e)。如果最终还剩下边,证明存在环,sort失败。 1 bool sort(list > &graph...
分类:其他好文   时间:2014-10-06 01:05:49    阅读次数:163
SQL Server 提高创建索引速度的 2 个方法
方法 1、 使用tempdb来提速 create index index_name on table_name (column_list) with(sort_in_tempdb = on);方法 2、 使用多线程为来提速 create index index_name on...
分类:数据库   时间:2014-10-05 17:11:48    阅读次数:204
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!