Need help for array linear list program in java

Assignment Help JAVA Programming
Reference no: EM131591427

Need help for array linear list program in java.

package data_structures;

import java.util.Iterator;
import java.util.NoSuchElementException;

public interface LinearListADT<E> extends Iterable<E> {
public static final int DEFAULT_MAX_CAPACITY = 100;

// Adds the Object obj to the end of list.
public void addLast(E obj);

// Adds the Object obj to the beginning of list.
public void addFirst(E obj);

// Inserts the Object obj at the position indicated. If there is an element at
// that location, all elements from that location to the end of the list are
// shifted down to make room for the new insertion. The location is one based.
// If the location > size()+1 then a RuntimeException is thrown. List elements // must be contiguous.
public void insert(E obj, int location);

// Removes and returns the object located at the parameter location (one based).
// Throws a RuntimeException if the location does not map to a valid position within the list.
public E remove(int location);

// Removes and returns the parameter object obj from the list if the list contains it, null otherwise.
// The ordering of the list is preserved. The list may contain duplicate elements. This method
// removes and returns the first matching element found when traversing the list from first position.
public E remove(E obj);

// Removes and returns the parameter object obj in first position in list if the list is not empty,
// null if the list is empty. The ordering of the list is preserved.
public E removeFirst();

// Removes and returns the parameter object obj in last position in list if the list is not empty,
// null if the list is empty. The ordering of the list is preserved.
public E removeLast();

// Returns the parameter object located at the parameter location position (one based).
// Throws a RuntimeException if the location does not map to a valid position within the list.
public E get(int location);

// Returns true if the parameter object obj is in the list, false otherwise.
public boolean contains(E obj);

// Returns the one based location of the parameter object obj if it is in the list, -1 otherwise.
// In the case of duplicates, this method returns the element closest to position #1.
public int locate(E obj);

// The list is returned to an empty state.
public void clear();

// Returns true if the list is empty, otherwise false
public boolean isEmpty();

// Returns the number of Objects currently in the list.
public int size();

// Returns an Iterator of the values in the list, presented in
// the same order as the underlying order of the list. (position #1 first)
public Iterator<E> iterator();

}

Reference no: EM131591427

Questions Cloud

Use at least two capital budgeting methods : Which should the company do and why? You must use at least two capital budgeting methods.
Analysis of the cyclical nature of nurse scheduling : Analysis of the Cyclical Nature of Nurse Scheduling, final project report for my internship at the american red cross
Evaluating investment from a large financial services firm : You are evaluating an investment from a large financial services firm.
General overview of the disease : Identify and choose a disease that affects an aging person's memory or cognitive ability. 4 to 5 Microsoft Word document that includes the following:
Need help for array linear list program in java : Need help for array linear list program in java - Removes and returns the object located at the parameter location (one based)
What part did the national labor relations act : What part did the National Labor Relations Act (Wagner Acct) play in union organizing? What were some major union highlights - needed to show.
What you have read and researched : Based on what you have read and researched, do you believe that the loss of biodiversity is a concern for humans?
Eight dimensions of organizational capacity for change : Identify and describe the Eight Dimensions of Organizational Capacity for Change (OCC). For each Dimension, discuss its significance to the organization.
Define the economic viability of the hospitality : There is growing recognition that traditional management practices have led to undesirable social and environmental impacts.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Determine statistics for a video game tournament

Write a program to determine statistics for a video game tournament and write a program to alphabetize a list of last names. The user will input an undetermined number of last names.

  Which announces whether or not the player has won the game

2D graphics, instead of text, to display the Xs and Os in the grids of the square- shaped buttons decision logic or recursion in order to determine whether or not a player wins the games. Display a message which announces whether or not the player ha..

  Designing a program with a while loop

The section entitled "In the Spotlight", "Designing a program with a while loop" describes the requirements for a project at Chemical Labs, Inc. Write a letter to the Director of Engineering that describe your concerns, if any, regarding these re..

  Implement a base class person

Implement a base class person

  Represent one book in java

Represent one book in java

  Your task is to design and implement a sorting

your task is to design and implement a sorting algorithmalgorithm that can sort nonnegative integers that fall within

  Discuss the use of a binary tree

Discuss the use of a binary tree when searching for keys in an array. Discuss the use of a binary tree when searching for keys in a linked list

  Object-oriented application to manage students

GPA is calculated using the Quality Point algorithm (each A is worth 4 points, B - 3, C - 2, D - 1, F - 0; Find the sum of that value times the number of credits for all courses, then divide by the total number of credits.).

  Program to computerize the billing system of a hospital

Design the class doctorType, inherited from the class personType, with an additional data member to store a doctor's specialty.

  Create a frame and set its layout to flowlayout

Create a frame and set its layout to FlowLayout, create two panels and add them to the frame and Each panel contains three buttons. The panel uses FlowLayout.

  What must a subclass do to modify a private superclass

When a class extends an abstract class, it must provide definition of all the methods that are declared in the abstract class. Otherwise, it gives a compile time error.

  Write a program creates circlearray

Write a program creates circleArray, an array composed of 10 Circle objects; it then initializes circle radius with any values (increase every time radius value by 5) and displays all circle object area's And also find total area of the circleArra..

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