Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW3-Summer08

Question Could you please explain in clear and concise terms what StringNode.java is supposed to do.

Question: I don't really see the whole picture. Can anyone please tell me what are we creating with this hw? Thank you

Question: For StringList.java the first two methods:
public StringList(){}
public StringList(StringNode head){}
have no return type. Are these supposed to be constructors?

Question:I don't understand exactly what our linked list is supposed to do. Is each node supposed to be a separate file? Since we are only turning in 2 files (one for the head, and one as the first node) does this linked like HW3 only have 2 nodes?

Question: Is there any way to check whether my codes are right or wrong (working properly)? For example, in CS1371 we were provided with an instance (lines of code to be executed in the interactions pane)and returns we should get if these codes were executed with the java class I have written.

Question: I cannot figure out how to open the javadoc that was posted. It keeps opening in Word, and is encrypted. Can someone please tell me how to open this?

Question: For the sortList() in the extra credit, how are the nodes supposed to be sorted?

Question: So I guess Main method is not required for this hw?

Question: What does the error message "unreachable statement mean" that I get when try to delete the first node. I got the unreachable statement for this:
if (current.getNext() != null)

Question: My code keeps running and running and running...What can I do about it?

Question: How do I actually create the linked list. When i try to test my methods, in the interactions pane i get some return that indicates that the list is empty. For instance, if i test: listTester.addToTail(two); it returns just: two

So where's my list to begin with?
Also, in the main method i have the following lines:
StringNode one = new StringNode("one");
  StringNode two = new StringNode("two");
  StringNode three = new StringNode("three");
  StringNode four = new StringNode("four");

Question: What is "toString()" supposed to do in StringNode.java? Does it just return what the string data is in the current node?

Question: I understand how providing an example(instance) is bad, but could you please give at least a simple example of what the homework is doing?
public static void main(String[]args){
  //declare the nodes
  StringNode dawnNode = new StringNode("Dawn");
  StringNode katieNode = new StringNode("Katie");
  StringNode smithNode = new StringNode("Professor REMOVED");
  StringNode ricardoNode = new StringNode("Ricardo");
  //link the nodes
  smithNode.setNext(katieNode);
  katieNode.setNext(ricardoNode);
  //create a list
  StringList cs1316List = new StringList(smithNode);
  //print the list before
  System.out.println(cs1316List);
  //test the method
  cs1316List.addToFront(dawnNode);
  //print the list after
  System.out.println(cs1316List);
}
Dawn Finney.

Question: I'm having a hard time understanding what the homework is supposed to do..

Question: When i have the following lines in the testing main
  StringNode one = new StringNode("one");
  StringNode two = new StringNode("two");
  StringNode three = new StringNode("three");
  StringNode four = new StringNode("four");
How do i link these nodes together to actually create the linked list?

Question: What does this error mean?
1 error found:
File: C:\Users\Works\2008\Georgia Tech\2008 Summer\Rep Behavior CS 1316\HW03\StringNode.java  [line: 56]
Error: C:\Users\Works\2008\Georgia Tech\2008 Summer\Rep Behavior CS 1316\HW03\StringNode.java:56: non-static method toString() cannot be referenced from a static context

Question: I did everything you said to do in the main method, yet it only prints out the one letter several times that I set to the front with the addToFront method. Why aren't the rest printed out? Also, the size of my list is 4, but I only get # 3 back after calling on that method.

Question: Well.. should System.out.println(cs1316list); not work because it's only a data structure? I mean, it's only a node, not a string...



Links to this Page