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
We are planning an orienteering game. The aim of this game is to arrive at the goal (G) from the start (S) with the shortest distance. However, the players have to pass all the che

A PCM system uses 8 bits per sample and the analog signal is limited to 4.3 kHz. The PCM data is transmitted using (a) BFSK and (b) ASK. Determine the bandwidth required for transm

Define Rules For Evaluating the Boolean Expression? Generally, the following rules must always be followed when evaluating the Boolean expression: Primary, perform all in

Function name or connective symbol: Whether if we write op(x) to signify the symbol of the compound operator then predicate name and function name or connective symbol are the

GlobalFon is an international communication company, which offers international prepaid calling cards. They introduced three different types of cards, (1) AsiaFon: is cheapest for

luminous jewels polishing game

Explain about Behavioral Notations These notations contain dynamic elements of the model.  Their elements comprise interaction and the state machine. It also comprise classe

Discuss briefly subscriber loop system. Subscriber Loop System: Every subscriber in a telephone network is connected usually to the nearest switching office using a dedicated

Explain the term step-wise refinement. Ans:  Step Wise Refinement  Refinement is a method of elaboration. Here one starts with a statement of function that is described a

Drawbacks to having call centres overseas -  Culture and language problems -  Animosity to overseas call centres (resulting in loss of customers) -  need for extensive r