Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Implement a singly linked list in ASCENDING sorted order. (You should not use any of Java built-in Collection classes). The data value in the node is a Song object. The sorting is based on the length of song.

Your Driver file must read song’s information from a Songs.txt file. The data file has a number of lines. Each line is in the format of “SongTitle@LengthOftheSong”.

Assumptions: No song has same title and length.

The linked list class must comprise methods to:

a) return the size of the linked list
public int size( ) { …}

b) print the linked list
public void print( ) { … }

c) test if x is contained in the linked list.
public boolean contains (E x) { …}

d) add a value x if it is not already contained in the linked list.
public boolean add(E x)

e) remove a value x if it is contained in the linked list.
public boolean remove(E x) { …}

Note:

1) The linked list must be generics.

2) You need to prepare equals method in Song class to check if two song objects are equivalent or not. If the title AND the length are all similar, then the method returns true.

3) You as well require writing compareTo method in the Song class to compare two song’s lengths.

4) The song objects are sorted by the lengths in the linked list.

Computer Engineering, Engineering

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

Have any Question?


Related Questions in Computer Engineering

A string in c is simply an array of characters with the

A string in C++ is simply an array of characters with the null character(\0) used to mark the end of the string. C++ provides a set of string handling function in as well as I/O functions in . With the addition of the ST ...

Assignmentsuppose you are a manufacturer of product abc

Assignment Suppose you are a manufacturer of product ABC, which is composed of components A, B, and C. Component A is further composed of parts X and Y. Each time a new product ABC is created, it must be recorded in the ...

Suppose we have a collection of n different subsets of the

Suppose we have a collection of n different subsets of the set { 1, 2, ..., n } and they are in some arbitrary order, that is, we have subsets S1, S2, ..., Sn, but how many and which elements are in each of these subsets ...

Simulate a dispatcher using a priority queue system in

Simulate a dispatcher using a priority queue system in Java. New processes are to be entered using a GUI with priority included (numbering should be automatic). Processes are also to be terminated by GUI command. Context ...

In a random sample of 100 male students 80 reported that

In a random sample of 100 male students, 80 reported that they were in favour of writing announced tests, while in a sample of 50 female students 23 favoured writing announced tests. Let the male students be population 1 ...

The literature on honeypots or so called fake networks to

The literature on honeypots or so called "fake networks" to attract hackers and attackers frequently mentions "entrapment" as one of the legal issues that must be considered. How of a concern is entrapment? What are some ...

String firstnamearraychar gradearrayassuming that this text

String firstName[ARRAY]; char grade[ARRAY]; Assuming that this text file is already inputted into the program. Write a loop that will display the students that have "A" or "B" next to their names. If the stuent has a "A" ...

A single precision ieee 754 number is stored in memory at

A single precision IEEE 754 number is stored in memory at address X. Write a sequence of ARM instructions to multiply the number at X by 16 and store the result back at X. You must accomplish this without using any float ...

Question an agile-focused mind-set in project

Question: "An Agile-focused Mind-set in Project Management" • Read the following two (2) articles: "The Scrum Guide," located here and "Core Scrum," located here. Contrast the role of a Scrum Master and the role of a pro ...

Question in official obenglobish the ob characters are

Question : In official Obenglobish, the ob characters are added only before vowels that are pronounced, which means that a word like "game" would become "gobame" rather than gobamobe because the final e is silent. While ...

  • 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