Create a doubly linked list class named linkeditemlist

Assignment Help Data Structure & Algorithms
Reference no: EM13970966

Data Structures and Algorithms

Assignment

The objectives of this assignment are to:

1. Further enhance your knowledge and skill in Java.

2. Gain an understanding and experience with doubly linked lists.

3. Gain an understanding and experience using generics.

  1. Gain further experience in using Javadoc documentation.

5. Continue to practice good programming techniques.

Part I:

Create a doubly linked list class named LinkedItemList that implements the following interface:

/**

 * An ordered list of items.

 */

public interface ItemList<E> {

/**

* Append an item to the end of the list

*

* @param item - item to be appended

*/

public voidappendItem(E item);

/**

* Insert an item at a specified index position

*

* @param item - item to be inserted

       * @param index - index position where to insert the item

* @throwIllegalArgumentException if index is < 0 or > no of items

*/

public void insertItemAt(E item, int index);

/**

 * Remove all items from the list

 */

public void clear();

/**

* Return an item at a specified index

*

* @param index - index of the item to return

* @return the item at the specified index

* @throwIllegalArgumentExceptionif index is < 0 or >= no of items

*/

public E getItem(int index);

/**

      * Return the index of the first occurrence of an item in the list.

      *

      * @return index of the first occurrence in the list, -1 if not found

      */

public intindexOf(Eitem);

/**

 * Get an ItemIterator to iterate over items in the list.

 *

 * @return an ItemIterator to iterate over items in the list

 */

public ItemIterator<E>iterator();

/**

* Remove an item at a specified index

*

* @param index - index of the item to be removed

* @return the removed item

* @throw IllegalArgumentExceptionif index is < 0 or >= no of items

*/

public E removeItemAt(int index);

/**

* Remove the first occurrence of an item in the list.

*

* @item - item to be removed

* @return true if an occurrence of the item was found and removed,

*         otherwise false

*/

public booleanremoveItem(Eitem);

/**

 * Return the number of items currently in the list

 *

 * @return the number of items in the list

 */

public intgetNoItems();

}

/**

 * An iterator over an ItemList

 */

public interface ItemIterator<E> {

/**

 * Return true if the iteration has more items

 *

 * @return true if the iteration has more items, otherwise false

 */

public booleanhasNextItem();

/**

 * Return next item from iteration

 *

 * @return next item from iteration

 * @throw NoSuchElementException if the iteration has no more items

 */

public E nextItem();

/**

 * Remove last item from returned iteration

 *

 * @throw NoSuchElementException if no item has been returned or if

 *        the item has previously been deleted

 */

public voidremoveItem();

}

You will need the appropriate constructors. In addition, you may also implement other methods that may be useful for the assignment (where possible define code in just one place). 

Part II:

Write a program to thoroughly test all of the methods of your LinkedItemList class.  Once you are confident is it working correctly, proceed to part III.

Part III:

On the tomcat drive in cosc310 you will find an eclipse project called assmt2.  On importing this project you will find a program CompanyReport which is similar to the Company and Bank projects.  That is they use arrays for 1 to N relationships between business objects.  Make the following modifications to CompanyReport to use ItemList and LinkedItemList.

1) Change the Company class to use LinkedItemList for your list of departments (instead of using an array).   Define the type of the departments variable to be a ItemList.  You will need to modify for loop accordingly.

2) Change Department to use LinkedItemList for the list of employees (instead of an array).  Define the employees variable as a ItemList of Employees.

3) Remove the methodgetEmployee(int index) from Department.  Instead add an ItemIteratorgetEmployees() method.  It just calls the iterator method on the employees variable and returns its ItemIterator.  Modify Department where needed to use getEmployees to iterate over the list of employees.

Additional Requirements:

1. Place ItemList and LinkedItemList into package edu.iup.cosc310.util

2. Provide a fast implementation for appendItem(), e.g., does not need to walk the list to get to the end.

3. Provide a fast implementation for getNoItems(), e.g., does not need to walk the list to count the number of items.

Reference no: EM13970966

Questions Cloud

Employees take in their negotiation with the financial firm : What kind of negotiations could help engage Indian employees and overcome some of the cultural problems encountered? How might culture play a role in the approach the Indian employees take in their negotiation with the financial firm?
What is the centripetal force acting on the car : What is the minimum coefficient of statistic friction between the tires and the track that will maintain this situation? If the tiles have a radius of 1.2m, what is the angular velocity of the tire? How many rotations do the tiles make on a single..
Variety of approaches to purchasing power parity : You were introduced to a variety of approaches to purchasing power parity. Select one purchasing power parity approach and explain why you chose it. Assess the approach you selected, identifying its characteristics and advantages for forecasting. In ..
Explain the background of one of the training videos : Explain the background of one of the training videos, the content, the learning objectives that it would meet, the time frame it will take, and the style of learners it will appeal to
Create a doubly linked list class named linkeditemlist : Create a doubly linked list class named LinkedItemList that implements the following interface. Write a program to thoroughly test all of the methods of your LinkedItemList class.
What is the amount of the companys accounts receivable : Calculating Float You have $35,400 on deposit with no outstanding checks or uncleared deposits. One day you write a check for $3,700 and then deposit a check for $5,300. What is your collection? What is the amount of the company's accounts receivable..
Find the accounting and cash break even units of production : The Marvel Mfg. Company is considering whether or not to construct a new robotic production facility. The cost of this new facility is $600,000 and it is expected to have a six-year life with annual depreciation expense of $100,000 and no salvage val..
Market value is related to idea of maximizing shareholder : The idea of maximizing market value is related to the idea of maximizing shareholder value, as market value is the price at which an asset would trade in a competitive setting. The sole concentration on shareholder value has been criticized, for conc..
Find he angular velocity of the system : Find: Free body diagram of the puck (looking at it from the side) when the center of rotation is to the left of it.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd