摘要:
读懂题目后就很简单了!取每个digit用的移位和&15的方法。 public static int[] countingSort(int[] keys, int whichDigit) { // Replace the following line with your solution. int[] 阅读全文
摘要:
挣扎了一下,没有想出更好的办法(哈哈哈哈哈哈 public UDGraph length2Paths() { UDGraph newGraph = new UDGraph(vertices); // Put your answer to Part I here. for(int i=0;i<vert 阅读全文
摘要:
注意分清楚vert和horiz就好。。。 part one walls的表达方法我是用的 v or h/i/j,最后split一下就可以了,也可以构造一个wall,感觉好像会比较简单。 public Maze(int horizontalSize, int verticalSize) { int i 阅读全文
摘要:
part one 网页找不到了。。 part two 前面大致是这个样子的,总体来说quick最快! 作业中有提到 gnuplot,有空再捣腾一下这个东西。 http://www.cnblogs.com/cocowool/archive/2011/07/03/2096924.html(转载) 所以用 阅读全文
摘要:
测试结果: part one 对于mergesortQueue这个函数可以最开始用front返回item来比较。。。之前脑筋又短路了。。。搞得有点复杂 public static LinkedQueue mergeSortedQueues(LinkedQueue q1, LinkedQueue q2 阅读全文
摘要:
测试结果: private BinaryTreeNode findHelper(Comparable key, BinaryTreeNode node) { // Replace the following line with your solution. BinaryTreeNode moving 阅读全文