ECET 370 Week 3 Lab 3 Linked Lists

Topics: Array data structure, Linked list, Class Pages: 3 (714 words) Published: October 28, 2014

This pack of ECET 370 Week 3 Lab 3 Linked Lists includes:

Exercise 1

Exercise 2

Exercise 3

Exercise 4

Exercise 5

Output

General Instructions

Exercises 1, 2, and 3 use the programs in DocSharing labeled “User-defined array list."

Exercise 4 uses the programs in DocSharing labeled “Using java.util.ArrayList."

Exercise 1: Review of array-based lists Create a project using the classes in the DocSharing area labeled “User-defined array list." Compile it, run it, and review the code that is given carefully. This code tests the ArrayList class provided in the lecture.

Exercise 2: A user-defined array list Modify the class ArrayList given in the lecture by adding to

it the functions listed below for Exercise 2. In each case, the appropriate error message should be generated if an invalid condition occurs. For example, an error message should be generated when trying to insert an item in a given location in the list and the location is out of range, a. ArrayList(inl size): create a constructor that sets the size of the array list to the value passed in size (note that the class variable SIZE cannot be final anymore), b. int length(): create this function to determine the number of items in the list (accessor function), c. int gelSize(): create this function to determine the size of the list (accessor function), d. void clear(): create this function to remove all of the items from the list. After this operation, the length of the list is zero, e. void replace(int location, int item): create this function to replace the item in the list at the position specified by location. The item should be replaced with item. f. void insert(int location, int item): create this function to add an item to the list at the position specified by location, g. void remove(int item): create this function to delete an item from the list. All ...

Search for more tutorials here - https://bitly.com/12AVRID

You surely realize that...
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • ECET 370 Week 5 Lab 5 Essay
  • Essay on Week 3 Individual Assignment
  • ECET 370 Week 1 Lab Essay
  • MAT540 Week 3 Homework Essay
  • Essay on week 3 medication list
  • Week 3 Lab Assignment Essay
  • Essay on Netw410 Week 3 Lab
  • EN1320 WEEK 3 LAB Essay

Become a StudyMode Member

Sign Up - It's Free