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

All 3 Assignments Complete. #6

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6739797
Implementing functions in ArrayIntList.java
Rob-P-Smith Jan 9, 2024
8b043a9
Implementing functions in ArrayIntList.java v2
Rob-P-Smith Jan 9, 2024
c86c340
Implementing functions in ArrayIntList.java, added iterator sub-class.
Rob-P-Smith Jan 9, 2024
a3e0e8f
Added Doubly Linked List
Rob-P-Smith Jan 16, 2024
4df1e73
Implementing methods.
Rob-P-Smith Jan 19, 2024
85c5584
Finished ArrayIntList class and added test shell.
Rob-P-Smith Jan 19, 2024
46e9cae
Working through fence post error.
Rob-P-Smith Jan 20, 2024
e643270
Working tests, all pass.
Rob-P-Smith Jan 20, 2024
89a69a7
ArrayIntList implemented fully with custom to string. Tests all items…
Rob-P-Smith Jan 20, 2024
134dd47
ArrayIntList implemented fully with custom to string. Tests all items…
Rob-P-Smith Jan 20, 2024
7ca4572
ArrayIntList implemented fully with custom to string. Tests all items…
Rob-P-Smith Jan 20, 2024
52b9d38
Updated tests to account for edge cases of throwing exception when th…
Rob-P-Smith Jan 20, 2024
823d3e3
Updated tests to account for edge cases of throwing exception when th…
Rob-P-Smith Jan 20, 2024
36e2f5f
Updated tests to account for edge cases of throwing exception when th…
Rob-P-Smith Jan 20, 2024
36ba8e1
Starting on LinkedList Class
Rob-P-Smith Jan 20, 2024
8936fed
Working on Linked List implementation. Added addBack() and toString()
Rob-P-Smith Jan 20, 2024
cc4652f
Merge remote-tracking branch 'origin/main'
Rob-P-Smith Jan 21, 2024
0da8780
Finished Contains, indexOf, get, size, clear
Rob-P-Smith Jan 21, 2024
c3efa55
Finished remove()
Rob-P-Smith Jan 21, 2024
5d0c834
Finished add()
Rob-P-Smith Jan 21, 2024
7930d14
Rebuilding the Tests and Lost Work...
Rob-P-Smith Jan 21, 2024
75f26cf
Working on DoublyLinkedLIst implementation..again
Rob-P-Smith Jan 21, 2024
05b7343
Added indexOf() and contains()
Rob-P-Smith Jan 22, 2024
fcdb55e
All Complete, pending debugging check and refactor.
Rob-P-Smith Jan 22, 2024
f10b0e6
All Complete.
Rob-P-Smith Jan 22, 2024
4a0786e
Refining my code a bit.
Rob-P-Smith Jan 22, 2024
29b4bf3
Converting applicable methods to recursive methods instead of iterative.
Rob-P-Smith Jan 23, 2024
c0ef879
Adding recursive add at index, in progress.
Rob-P-Smith Jan 23, 2024
76c20aa
Adding recursive add at index, in progress. Disabled and re-enabled i…
Rob-P-Smith Jan 23, 2024
a4d9cfc
Fixing iterator sub class.
Rob-P-Smith Jan 23, 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
ArrayIntList implemented fully with custom to string. Tests all items…
… and functions as expected.

Struggles with large data sets due to linear search use.

Rev2
Rob-P-Smith committed Jan 20, 2024
commit 134dd479f4004e653060771e3e4db857b28b3621
21 changes: 12 additions & 9 deletions src/ArrayIntList.java
Original file line number Diff line number Diff line change
@@ -235,16 +235,9 @@ private void resize(int newSize) {
}

/**
* Returns an iterator over elements of type {@code T}.
*
* @return an Iterator.
* Custom toString for this arraylist implementation that returns a stringified display of the contents
* @return a string of the contents of the arraylist
*/
@Override
public Iterator<Integer> iterator() {
return null;
}


@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -263,6 +256,16 @@ public String toString() {
return sb.toString();
}

/**
* Returns an iterator over elements of type {@code T}.
*
* @return an Iterator.
*/
@Override
public Iterator<Integer> iterator() {
return new IntListIterator();
}

private class IntListIterator implements Iterator<Integer> {
private int i;

4 changes: 3 additions & 1 deletion src/Main.java
Original file line number Diff line number Diff line change
@@ -27,10 +27,12 @@ public static void main(String[] args) {
System.out.println(testList.toString());
System.out.println("The array has a size of: " + testList.size());
System.out.println("Adding enough elements to force a resize");
for (int i = 0; i < 16; i++){
for (int i = 0; i < 15; i++){
testList.addBack(i);
}
System.out.println("New array size: "+testList.size());
System.out.println(testList.toString());
testList.add(3,3);
System.out.println(testList.toString());
}
}