CSC 103 Lab Notes Week 2
Working Seriously on Assignment 1



  1. Copy all of the Java files from ~gfisher/classses/103/examples into your csc103 working directory. (This is the directory you created in the week 1 lab.)

  2. Temporarilty remove the GeneralList.java template file (it does not compile as is).

  3. Compile all of the programs using the javac compiler. (I.e., use the command "javac *.java".

  4. Make a javadoc directory. (Use the command "mkdir javadoc".)
    1. Compile javadoc documentation for the Java files using the command
      javadoc -d javadoc *.java
      
    2. Go to your home directory, using the command "cd ~"
    3. Make the javadoc directory you just created visible to a browser using the following UNIX commands:
      mkdir public_html
      cd public_html
      ln -s ../csc103 .
      cd ~
      chmod -R a+rX csc103 public_html
      
    4. Bring up a web browser (netscape in the lab) and goto the following URL
      http://latte.java.calpoly.edu/~yourid/csc103/javadoc
      where yourid is your latte login id.

  5. Consider the following tips for working on Assignment 1:
    1. Recopy the GeneralList.java template file from ~gfisher/classes/assignments/1/GeneralList.java
    2. Get the GeneralList template to compile with a minimal amount of new work. (Hint: this means you must fill-in some dummy return statements for all of the non-void methods).
    3. Copy the code from from the ListAsLinkedList example into the appropriate locations of the GeneralList.java file.
    4. Write your own test program to call your newly-implemented methods GeneralList.GeneralList, GeneralList.putFirst, GeneralList.clear, and GeneralList.sort.
    5. Implement and test some of the simpler GeneralList methods, such as length and isEmpty
    6. Implement a GeneralList.linearSearch method and use it to implement the elementOf and findIndex methods.
    7. Adapt the code for the putFirst method to implement putLast and put.
    8. Adapt the code for the putFirst method to implement the remove methods.
    9. Implement the array-valued GeneralList constructor.
    10. Implement the equals and toString methods.
    11. Figure out how you're going to get binarySearch to work in O(log N) time on a GeneralList, and adapt the code in the ListSearch example accordingly.




index | lectures | labs | handouts | examples | assignments | solutions | doc | grades | help