Tuesday, November 30, 2010

Lab 22 - LinkedList.java -- with Generics -- Fill in the Function Bodies


1) Remove the quotes. I had to put in order to get the E to print.
2) First Refer to the Book to Fill in the Similar Functions and then try yourself the non-similar ones 

import java.util.ArrayList;


public class LinkedList<"E extends Comparable"<"E">>

{

 private ListNode<"E"> head;


 public LinkedList()

 {

  head = null;

 }


 public void showList()

 {

 
 }


 public int length()

 {

 
 }


 public void addNodeToStart(E addData)
 {
 
 }

 public void deleteHeadNode()
 {


 }

 public boolean onList(E target)
 {
 
 }

 public ListNode<"E"> contains(E target)
 {
 

 }

 public void addNodeAfterN(E theData, int n)
 {
 

 }

 public void deleteAfterNodeN(int n)
 {
 

 }

 public ArrayList<"E"> toArrayList()
 {
 
 
 }

}

No comments: