DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Notes about Robert Sedgewick: Algorithms


Unresolved imports in StdDraw3D.java

download j3d-1_5_2-windows-i586.zip from http://java3d.java.net/binary-builds.html, then extract j3dcore.jar, j3dutils.jar & vecmath.jar from $ZIP_FILE/j3d-jre.zip/lib/ext, then add these jars into classpath of project of StdLib which is built from stdlib-package.jar from official booksite: algs4.cs.princeton.edu. Reference: http://stackoverflow.com/questions/2352364/where-to-get-com-sun-j3d-classes

How to create a customized Iterable Class

p141, algorithm 1.1, and corresponding source file ResizingArrayStack.java in downloaded algs4.jar file. The "Item" in ResizingArrayStack is a parameter. That is to say, you can change its name to anything. For example: ResizingArrayStack implements Iterable { ... or: ResizingArrayStack implements Iterable { ... The method "next()" in private class "ReverseArrayIterator" will not be used in client main method. But we can demonstrate its usage by adding the following snippet in main method: for (String i : s) { System.out.println("i= " + i); }

About exercises solutions

Some exercises solutions can be found at http://algs4.cs.princeton.edu/code/;

How to plot graphs of algorithms

Use StdDraw.java. Some use cases can be found at Section 1.5 of Introduction to Programming in Java: An Interdisciplinary Approach by Robert Sedgewick and Kevin Wayne.



Published

Jan 4, 2013

Last Updated

Jan 4, 2013

Category

Tech

Tags

  • algorithm 9
  • Eclipse 40
  • Java 106

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor