1 / 2

Ics202 Data Structures

Ics202 Data Structures.

Download Presentation

Ics202 Data Structures

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ics202Data Structures

  2. Step1: Create a project named OrderedListAsArrayTestStep2: Copy and paste the ADTs folder in OrderedListAsArrayTest folderStep3: Define a class OrderedListAsArrayTest in which:You create the main() method1- Instantiate the OrderedListAsArray class with an object named mylist with array size equals 5.2- Fill mylist with the integers 2, 4, 6, 8, and 10 (use the method insert(Comparable object)).3- Display the elements of mylist: use the hasMoreElements() and nextElement() methods of the interface Enumeration and a whileloop.4-Remove 10 from mylist (use withdraw(Comparableobj) method).5- Display the elements in mylist (use the accept() method of the interface Visitor.).6- Remove the element at position 0 from mylist (use MyCursor class and withdraw() method). 7-Display the elements in mylist (use the accept() method of the interface Visitor.). 8- Insert 5 after the first element of mylist (use insertAfter(Comparable obj)).9- Insert 7 before 8 (use findPosition(Comparable obj) to locate the position of 8 and insertBefore(Comparable obj)).10- Display the elements in mylist (use the accept() method of the interface Visitor.).

More Related