随笔分类 -  算法Sedgewick第四版

摘要:Multi-word search. Program MultiwordSearch.java reads a sequence of query words q[1], ..., q[k] from the command line and a sequence of documents word 阅读全文
posted @ 2016-04-20 11:47 shamgod 阅读(292) 评论(0) 推荐(0)
摘要:1 /****************************************************************************** 2 * Compilation: javac QueueWithTwoStacks.java 3 * Execution: java QueueWithTwoStacks { 17 private ... 阅读全文
posted @ 2016-04-20 11:39 shamgod 阅读(284) 评论(0) 推荐(0)
摘要:1 package algorithms.ADT; 2 3 /****************************************************************************** 4 * Compilation: javac DoublyLinkedList.java 5 * Execution: java Dou... 阅读全文
posted @ 2016-04-20 11:21 shamgod 阅读(306) 评论(0) 推荐(0)
摘要:1 /****************************************************************************** 2 * Compilation: javac EvaluateDeluxe.java 3 * Execution: java EvaluateDeluxe 4 * Dependencies: S... 阅读全文
posted @ 2016-04-20 10:39 shamgod 阅读(247) 评论(0) 推荐(0)
摘要:1 package algorithms.fundamentals001; 2 3 import java.util.Locale; 4 import java.util.Scanner; 5 6 import algorithms.util.StdIn; 7 8 public class IsEquals { 9 10 // assume Unicode ... 阅读全文
posted @ 2016-04-20 10:26 shamgod 阅读(330) 评论(0) 推荐(0)
摘要:1 /************************************************************************* 2 * 3 * Josephus problem 4 * 5 * % java Ex_1_3_37 7 2 6 * 1 3 5 0 4 2 6 7 * 8 *******************... 阅读全文
posted @ 2016-04-19 18:01 shamgod 阅读(256) 评论(0) 推荐(0)
摘要:1 /************************************************************************* 2 * 3 * A generic queue, implemented using a *circular* linked list. 4 * (Exercise 1.3.29) 5 * 6 * ... 阅读全文
posted @ 2016-04-19 17:52 shamgod 阅读(262) 评论(0) 推荐(0)
摘要:1 import java.util.Iterator; 2 import java.util.NoSuchElementException; 3 4 public class List implements Iterable 5 { 6 private int N; 7 private Node first; 8 private N... 阅读全文
posted @ 2016-04-19 17:52 shamgod 阅读(216) 评论(0) 推荐(0)
摘要:1 package algorithms.exercise; 2 3 import algorithms.ADT.Stack; 4 import algorithms.util.StdIn; 5 import algorithms.util.StdOut; 6 7 8 /**************************************************... 阅读全文
posted @ 2016-04-19 17:14 shamgod 阅读(257) 评论(0) 推荐(0)
摘要:1 @Test 2 public void e1_3_5() { 3 Stack stack = new Stack(); 4 int N = 7; 5 while (N > 0) { 6 stack.push(N % 2); 7 N = N / 2; 8 ... 阅读全文
posted @ 2016-04-19 17:02 shamgod 阅读(195) 评论(0) 推荐(0)
摘要:1 /****************************************************************************** 2 * Compilation: javac Parentheses.java 3 * Execution: java Parentheses 4 * Dependencies: In.java Sta... 阅读全文
posted @ 2016-04-19 16:52 shamgod 阅读(213) 评论(0) 推荐(0)
摘要:用泛型的 可变大小的 阅读全文
posted @ 2016-04-18 21:28 shamgod 阅读(251) 评论(0) 推荐(0)
摘要:1. 阅读全文
posted @ 2016-04-18 11:33 shamgod 阅读(283) 评论(0) 推荐(0)

haha