Guava的Ordering可以说是更加强大的Javacomparator,Ordering本身就是一个继承于Comparator的接口,但是它还支持一些基于Comparator的操作例如reverse,max,min,它甚至还可以通过不同Ordering之间的组合或者链接(用Decorate的模式)完成更加强大的排序功能。创建有四种比较常见..
分类:
其他好文 时间:
2014-08-28 09:50:19
阅读次数:
154
Problem FOrdering TasksInput: standard inputOutput: standard outputTime Limit: 1 secondMemory Limit: 32 MBJohn has n tasks to do. Unfortunately, the t...
分类:
其他好文 时间:
2014-08-15 14:34:28
阅读次数:
141
Consider integer numbers from 1 to n. Let us call the sum of digits of an integer number its weight. Denote the weight of the number x as w(x).
Now let us order the numbers using so called graduated ...
分类:
其他好文 时间:
2014-08-10 18:47:20
阅读次数:
406
#include #include #include #include #include #include #include using namespace std;const char*dirs="NESW";const char*turns="FLR";int r0,c0,dir,r1,c1,r...
分类:
其他好文 时间:
2014-07-27 09:45:02
阅读次数:
376
题目如下:
Bandwidth
Given a graph (V,E) where V is a set of nodes and E is a set of arcsin VxV, and an
ordering on the elements in V, then the bandwidth of a node
v is defined as...
分类:
其他好文 时间:
2014-07-19 02:26:15
阅读次数:
206
本题要求输出全部拓扑排序的序列。
还好本题的数据量不是很大,限制在26个大写英文字母,故此可以使用递归法输出。
这个递归输出全部解在Leetcode很多这样的题目的,不小心的话,还是很难调试的。
总体考了递归和拓扑排序,还有判断是否可以拓扑排序-就是是否图有环。
考了三大知识点,难度还是有的。因为数据量不大,故此判断环可以使用一般递归方法,递归只需要注意细节就好了。
#incl...
分类:
其他好文 时间:
2014-07-08 15:35:30
阅读次数:
141
Topological Sort题解。本题是简单的入门题目。
Topological Sort的思想很简单,就是按没有入度的点,先输出,然后删除这个点的出度。然后输出下一组没有入度的点。
如何实现也是很简单的:
这里使用邻接表,建图的时候反过来建图,建立一个入度邻接表。
然后使用一个vis数组,记录访问过的节点,也可以根据这个信息知道哪些是已经输出的点,这个时候这些点的入度可以不算为当前入...
分类:
其他好文 时间:
2014-07-08 12:46:41
阅读次数:
282
Right-BICEPRight首先,我们需要知道什么是正确的.这是最基本的.Boundary边界是否所有的边界条件都正确?CorrectConformance一致性结果值是否和期望值一致.Ordering顺序性值是否跟期望一样,是有序/无序的.Range区间性值是否位于合理的最大值和最小值之间.R...
分类:
其他好文 时间:
2014-06-17 19:51:20
阅读次数:
166
1,MESSAGE: Input files reads and reference have
incompatible contigs: Relative ordering of overlapping contigs differs, which is
unsafe.##### ERROR re...
分类:
其他好文 时间:
2014-06-13 07:46:21
阅读次数:
1050