{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Linear Data Structures 1.4

# Linear Data Structures 1.4 - Last Updated 9:52 AM CSE 2011...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Last Updated: 12-01-17 9:52 AM CSE 2011 Prof. J. Elder - 16 - The Array List ADT (§6.1) • The Array List ADT extends the notion of array by storing a sequence of arbitrary objects • An element can be accessed, inserted or removed by specifying its rank (number of elements preceding it) • An exception is thrown if an incorrect rank is specified (e.g., a negative rank) Last Updated: 12-01-17 9:52 AM CSE 2011 Prof. J. Elder - 17 - The Array List ADT /** Simplified version of Java.util.ArrayList */ public interface IndexList<E> { /** Returns the number of elements in this list */ public int size(); /** Returns whether the list is empty. */ public boolean isEmpty(); /** Inserts an element e to be at index I, shifting all elements after this. */ public void add(int I, E e) throws IndexOutOfBoundsException; /** Returns the element at index I, without removing it. */ public E get(int i) throws IndexOutOfBoundsException; /** Removes and returns the element at index I, shifting the elements after this. */ /** Removes and returns the element at index I, shifting the elements after this....
View Full Document

{[ snackBarMessage ]}

### Page1 / 5

Linear Data Structures 1.4 - Last Updated 9:52 AM CSE 2011...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online