Commit 6f67538d authored by Adam Blank's avatar Adam Blank
Browse files

Code after lecture04

parent eb522d83
No related merge requests found
Showing with 7 additions and 20 deletions
+7 -20
......@@ -23,21 +23,6 @@ public class OurArrayList<E> implements IList<E> {
return "[" + elements + "]";
}
/**
* Puts element at index idx, shifting over everything after to the right.
* @param idx
* @param element
* For example, idx = 2, element = 42
* [1, 2, 3, 4, 5]
* ^
* [1, 2, 42, 3, 4, 5]
*/
public void add(int idx, int element) {
}
@Override
public int size() {
return this.size;
......@@ -55,6 +40,7 @@ public class OurArrayList<E> implements IList<E> {
}
@Override
public E get(int idx) {
return null;
}
......@@ -64,6 +50,12 @@ public class OurArrayList<E> implements IList<E> {
this.size = 0;
}
@Override
public void add(int idx, E elem) {
}
@Override
public void add(E elt) {
if (this.size == this.data.length) {
E[] newData = (E[])new Object[this.size * 2];
......@@ -76,10 +68,5 @@ public class OurArrayList<E> implements IList<E> {
this.size++;
}
@Override
public void add(int idx, E elem) {
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment