Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finished all code and tests #12

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c255f6b
implementing methods
AddisonFarley Jan 4, 2024
cd074ee
finished addFront and addBack
AddisonFarley Jan 4, 2024
8f26ee0
finished get and size
AddisonFarley Jan 4, 2024
d6e1338
finished remove and contains methods
AddisonFarley Jan 9, 2024
87b67b2
created private resize method. finished clear and isEmpty. Started on…
AddisonFarley Jan 9, 2024
e1fac91
created private sizeCheck method and put into all add methods
AddisonFarley Jan 9, 2024
e8a9ab6
created private sizeCheck method and put into all add methods
AddisonFarley Jan 9, 2024
7eb802a
Created LinkedIntList.java and DoublyLinkedIntList.java
AddisonFarley Jan 16, 2024
dbee766
completed addBack() and removeBack() for DoublyLinkedIntList.java
AddisonFarley Jan 16, 2024
94495ae
completed iterator methods and classes for ArrayIntList.java and Link…
AddisonFarley Jan 18, 2024
adc28d5
finished all methods
AddisonFarley Jan 22, 2024
9f3af36
fixed traversal bugs
AddisonFarley Jan 22, 2024
01370c5
finished LinkedIntList.java methods
AddisonFarley Jan 22, 2024
a8ca925
fixed indexOutOfBoundsChecker bug
AddisonFarley Jan 22, 2024
1749a31
finished ArrayIntList.java methods
AddisonFarley Jan 22, 2024
231856a
fixed bugs in addFront(), removeFront(), remove(), and size()
AddisonFarley Jan 22, 2024
06da242
created test files
AddisonFarley Jan 22, 2024
149b8e3
created ArrayIntList.java tests
AddisonFarley Jan 22, 2024
eb4bed3
fixed bugs in removeFront() and removeBack()
AddisonFarley Jan 22, 2024
4e8346a
fixed multiple bugs
AddisonFarley Jan 22, 2024
a0db349
created tests
AddisonFarley Jan 22, 2024
7646bfc
fixed bugs added more comments
AddisonFarley Jan 22, 2024
153aa70
fixed bugs in DoublyLinkedIntList.java, created tests for DoublyLinke…
AddisonFarley Jan 24, 2024
cef78c5
added iterator for DoublyLinkedIntList.java
AddisonFarley Jan 24, 2024
1875f04
forgot testing of resizing
AddisonFarley Jan 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
completed iterator methods and classes for ArrayIntList.java and Link…
…edIntList.java
AddisonFarley committed Jan 18, 2024
commit 94495aede9e5e60c5f2300d6ba56beab2d1764ea
6 changes: 3 additions & 3 deletions src/ArrayIntList.java
Original file line number Diff line number Diff line change
@@ -233,15 +233,15 @@ public void clear()
@Override
public Iterator<Integer> iterator()
{
return null;
return new IntListIterator();
}

//create private helper iterator class
private class intListIterator implements Iterator<Integer>
private class IntListIterator implements Iterator<Integer>
{
private int i;

public intListIterator()
public IntListIterator()
{
i = 0;
}
29 changes: 27 additions & 2 deletions src/LinkedIntList.java
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ public boolean isEmpty()
@Override
public int size()
{
return 0;
return size;
}

/**
@@ -161,6 +161,31 @@ public void clear()
@Override
public Iterator<Integer> iterator()
{
return null;
return new SinglyLinkedIterator();
}

//helper class that defines how the iterator works
private class SinglyLinkedIterator implements Iterator<Integer>
{
private Node curr;

public SinglyLinkedIterator()
{
curr = head;
}

@Override
public boolean hasNext()
{
return curr.next != null;
}

@Override
public Integer next()
{
curr = curr.next;

return curr.data;
}
}
}