Test 1 - //TEST #14

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: //TEST #14 ----------------------------------------------------------------------- public boolean ident(){ boolean result=false; if(alist.getLength() >=2 && alist.getEntry(1).equals(alist.getEntry(2))) result=true; return result; } // end ident //TEST #15 ----------------------------------------------------------------------- int numberOfEntries = alist.getLength(); System.out.println("The list contains " + numberOfEntries + " entries in a reverse order, as follows:"); for (int position = numberOfEntries; position >= 1; position--) System.out.println(alist.getEntry(position) + " is entry " + position); //TEST #16 ----------------------------------------------------------------------- if( alist.isEmpty()){ alist.add(1, 'aa'); } /*TEST #22 ----------------------------------------------------------------------- Write a boolean method called isTooBig() that returns true if the array-based list is sparse, wasting too much space. Imagine the isTooBig() method you're writing is defined inside the list wasting too much space....
View Full Document

This note was uploaded on 01/23/2012 for the course CS 111C taught by Professor Metzler during the Spring '11 term at City College of San Francisco.

Page1 / 2

Test 1 - //TEST #14

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online