Introduction to the sorted arraylist, Computer Engineering

Assignment Help:

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.


Related Discussions:- Introduction to the sorted arraylist

Transition management system, please help me with psudocode for schedule ma...

please help me with psudocode for schedule management which contains stakeholder and application table

Where time synchronization is necessary, Time synchronization is necessary ...

Time synchronization is necessary in? Time synchronization is essential in TDM.

Explain the working of a two input EX-OR gate, With relevant logic diagram ...

With relevant logic diagram and truth table explain the working of a two input EX-OR gate. Ans. 2-Input EX-OR Gate: An EX-OR or Exclusive gate recognizes words that have an od

Explain segmentation, Explain segmentation? Segment memory addressing ...

Explain segmentation? Segment memory addressing divides memory into many segments. Each of these segments can be considered as a linear memory space. Every one of these segmen

How a pointer variable declared in c, How a pointer variable declared in C ...

How a pointer variable declared in C ? Why is it sometimes desirable to pass a pointer to a function as an argument? A pointer is a variable which contains the address in memor

the bias and standard error , A random variable (X) is modelled as an expo...

A random variable (X) is modelled as an exponentially distributed with mean 30 units. Simulate N = 50 samples from this distribution, and every sample must have m = 20 simulated va

Implementation of arithmetic circuits, Implementation of Arithmetic Circuit...

Implementation of Arithmetic Circuits for Arithmetic Micro-operation  An arithmetic circuit can be implemented by a number of full adder circuits or parallel adder circuits. F

Web technology, Write short notes on Event Model.

Write short notes on Event Model.

Explain about binning?, Binning process is very helpful to save space. Perf...

Binning process is very helpful to save space. Performance may differ depending upon the query generated sometimes solution to a query can come within some seconds and sometimes it

Layered architecture.., advantages and disadvantages of layered architectur...

advantages and disadvantages of layered architecture in computer network.

Write Your Message!

Captcha
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