Introduction to the sorted arraylist, Computer Engineering

Consider  a  collection  class  that  is  similar  to  the ArrayList  class,  except  that  elements  are sorted in a certain order. We will call this class SortedArrayList. This class has many of the same simple features  that  the ArrayList class has, but  it also has some new features  that  is different to the ArrayList class. 

The main difference is that each element (which can be of any class type) that is added into the  SortedArrayList  also  has  a  corresponding  priority,  which  is  a  decimal  number.  All elements  in  the  SortedArrayList  need  to  be  sorted  in  descending  order  (highest  priority comes first) according to their priorities at all times.

For example, if there is a list of String objects, with values "A", "B", "C" and "D", and their corresponding  priorities  are  62,  13,  71  and  38,  then  the  Strings  should  appear  in  the SortedArrayList in this order:
 
"C" (with priority 71), "A" (62), "D" (38), "B" (13)
 
In Part  1  of  the Assignment,  your  task  is  to write  the SortedArrayList  class  (its  instance variables, constructor and instance methods) as well as perform thorough unit testing on this class.

You should download SortedArrayList.java from the course website to help you get started.
 
·  It  already  contains  the  headers  of  the methods  (including  the  constructor)  that  you must write. Each method is described with a comment above the method header; you have to write the code inside the methods to perform according to the comment. You should NOT change any of the method headers.

·  You may choose to write more methods if that helps you. ·  There  is  already  1  instance  variable  declared;  you must NOT  change  this  instance variable declaration.

Posted Date: 2/22/2013 2:21:21 AM | Location : United States







Related Discussions:- Introduction to the sorted arraylist, Assignment Help, Ask Question on Introduction to the sorted arraylist, Get Answer, Expert's Help, Introduction to the sorted arraylist Discussions

Write discussion on Introduction to the sorted arraylist
Your posts are moderated
Related Questions
What is the Gray equivalent of  (25) 10 Ans. Gray equivalent of (25) 10 : The Decimal number 25 has binary equivalent as (00100101) 2 The left most bits (MSB) into gray

Image Capturing Download the following grey level 512x512 standard images in TIF format: a-Lena       b-Baboon     c-Bridge       d-Airfield Use Matlab to decrease the siz

An ActiveX control has four types of properties: 1. Stock:-> These are standard properties supplied to each control, such as font / color. The developer must activate stock pro

Parallel Computers In India, the design and development of parallel computers in progress in the early 80?s. The Indian Government recognized the Centre for Development of Adva

The objective of this practical assignment is to use the POSIX environment to write a program that simulates the supply and demand between three processes: warehouse, factory and r

What is system testing? The final step in testing is system testing, which means checking the whole application. System testing exercises the overall application and make sure

Q. What is Multiple Interrupt Lines? Multiple Interrupt Lines: Simplest solution to problems above is to provide multiple interrupt lines that will result in immediate recognit

write alp to perform bcd addition without using procedure

PROCEDURE TO CREATE PROJECT IN COLLABORATION SYSTEM

Data, information and knowledge - Information System The nature of information can most easily be defined in the context of its relationship to data and knowledge. Bohn (1994)