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

What is a digital multiplexer, What is a digital multiplexer?  Ans: ...

What is a digital multiplexer?  Ans: Multiplexer: Data selector or MUX is a logic circuit selects binary information from one of several input and directs this to a sing

Rules for minimisation using k maps, 1) All squares containing a 1 must be ...

1) All squares containing a 1 must be grouped. 2) The largest possible groups must be formed. 3) Groups can overlap if this allows larger groups to be formed. 4) Groups mu

Microprocessor 8086, i want to know complete detail of 8086 microprocessor ...

i want to know complete detail of 8086 microprocessor such as memory segment ,interface with ram rom ect

What is the main use of structures, What is The main use of structures ...

What is The main use of structures The main use of structures is to lump together collections of disparate variable types, so they can conveniently be treated as a unit. For ex

Why does ipv6 use separate extension headers, Why does IPV6 use separate ex...

Why does IPV6 use separate extension headers? Explain. The extension headers in Ipv6 are utilized for economy and extensibility. Partitioning the datagram functionality in sepa

Requirements of decision support system, Q. Requirements of decision suppor...

Q. Requirements of decision support system? a) Fast computation A decision maker is able to perform a large number of computations very quickly and that too at a low cost

Determine the function of dynamic model, Determine the function of Dynamic ...

Determine the function of Dynamic model Dynamic model: Dynamic model describes how system responds to external events. The implementation of the control flow in a program must

Hubs are present in the network, Hubs are present in the network To inte...

Hubs are present in the network To interconnect the LAN with WANs.

Give brief explanation about the keyboards, Give brief explanation about th...

Give brief explanation about the keyboards Keyboards are generally not offered as the number of options is limited and owners of the system do not want customers keying in info

What is meant by super scalar processor, What is meant by super scalar proc...

What is meant by super scalar processor?  Super scalar processors are designed to exploit more instruction level parallelism in user programs. This means that multiple function

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