Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9523651

Have any Question?


Related Questions in Computer Engineering

Use the management studio to create a new database called

Use the Management Studio to create a new database called the default settings(If the database already exists, use the Management Studio to delete it and than create it.

Show how an avl tree can have a deepest leaf at depth 4 and

Show how an AVL tree can have a deepest leaf at depth 4 and another leaf at depth 2, and still be balanced. Show the same thing for a Red/Black tree. If there were an AVL tree and Red/Black tree with deepest leaves at de ...

Select two application areas for data mining not discussed

Select two application areas for data mining NOT discussed in the text book and briefly discuss how data mining is being used to solve a problem (or to explore an opportunity)?

1 market equilibrium and deadweight lossa suppose that the

1. Market Equilibrium and Deadweight Loss a) Suppose that the supply and demand for apples are as follows: QD = 100 - 3P QS = 50 + 2P The government now levies a $5 per unit tax on producers. Draw the supply and demand c ...

Bond a is a 1-year zero-coupon bond bond b is a 2-year

Bond A is a 1-year zero-coupon bond. Bond B is a 2-year zero-coupon bond. Bond C is a 2-year 10% coupon bond that pays annually. The yield to maturity (annually compounded) on bond A is 10%, and the price of bond B is $8 ...

What is the role of arp and how does it cause a security

What is the role of ARP and how does it cause a security concern? What is the different between global and private IP addresses? How does using NAT change a private IP address into a global IP address, and why is this so ...

Excel discussionconsider this using the mouse to point and

Excel discussion Consider this.... Using the mouse to point and click is one way to work on a computer. Often, the same work can be accomplished using just the keyboard, using shortcut keyboard combinations. For example, ...

Are search algorithms tied to data structures being

Are search algorithms tied to data structures being searched, or can they be utilized in other scenarios?

What are the similarities and differences of hierachical

What are the similarities and differences of hierachical, Network, and Object Oriented Database Models.

Assignment - confidential organizational information and

Assignment - Confidential Organizational Information and Employee Responsibility As an employee, you are often required to sign confidentiality agreements when beginning work at a new company. You may also be required to ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As