Skip to content
Snippets Groups Projects
Commit 67f937b1 authored by Lawrence Chung's avatar Lawrence Chung
Browse files

Change Fish to Bag

parent 558eb6e1
No related branches found
No related tags found
No related merge requests found
......@@ -2,15 +2,19 @@ package search;
import java.util.Iterator;
public class Fish<Integer> implements Iterable<Integer> {
public class Bag<Integer> implements Iterable<Integer> {
private Node first;
private Node first; //pointer to head of linked list
private class Node{
Integer item;
Node next;
}
/**
* Adds new node to linked list
* @param item the item to be added to the linked list
*/
public void add(Integer item){
Node oldfirst = first;
first = new Node();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment