Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- MyArrayList list = new MyArrayList(100000);
- int i = 0;
- while(i<10){
- list.insertItem((int) (Math.random() * 100), list.getSize());
- i = i + 1;
- }
- list.display();
- System.out.println( "Item at index 2 = " + list.getItem(2));
- // System.out.println( "Item at index 200000 = " + list.getItem(200000));
- System.out.println("Inserting 999 at position 5");
- list.insertItem(999, 5);
- list.display();
- System.out.println("Deleting from position 2");
- list.removeItem(2);
- list.display();
- randomAccessPerformanceDemo(list, 20, list.getCapacity());
- insertPerformanceDemo(list, 20, list.getCapacity());
- removePerformanceDemo(list, 20, list.getCapacity());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement