Ask Question, Ask an Expert

+1-415-315-9853

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

Exercises for section 42in exercises 421 through 427 draw

EXERCISES for Section 4.2 In Exercises 4.2.1 through 4.2.7, draw the depth-first tree that results when Algorithm 4.2.1 is applied to the graph shown below, starting at the specified vertex. Include the dfnumbers and use ...

1 search your librarys database and the web for an article

1. Search your library's database and the Web for an article related to individuals violating their organization's policy and being terminated. Did you find many? Why or why not? 2. Go to the (ISC)2 Web site at www.isc2. ...

1 can a router combine the advertisement of a link and a

1. Can a router combine the advertisement of a link and a network in a single link-state update? 2. Explain why we can have different intradomain routing protocols in different ASs, but we need only one interdomain routi ...

Implement a queue as a linked linear list such that it only

Implement a queue as a linked linear list such that it only occupies an amount of space proportional to the current queue size

How can us companies protect their digital assets

How Can U.S. Companies Protect their Digital Assets Overseas? Prepare a 3 to 5 paragraph briefing statement that can be used to answer the above question. Your audience will be attendees at a conference for small busines ...

1 assume a 64 kib direct-mapped cache with a 32-byte block

1. Assume a 64 KiB direct-mapped cache with a 32-byte block. What is the miss rate for the address stream above? How is this miss rate sensitive to the size of the cache or the working set? How would you categorize the m ...

1 research and discuss the much-talked-about role of

1. Research and discuss the much-talked-about role of public-key authentication in the future of e-commerce. Is the role of PKI in authentication exaggerated? 2. Study the dial-in authentication mechanisms. What mechanis ...

For many years industries and financial institutions hired

For many years, industries and financial institutions hired people who broke into their systems once those people were released from prison. Now, such a conviction tends to prevent such people from being hired. Why you t ...

Identify a major information security incident that has

Identify a major information security incident that has occurred in the recent past (within the last five years).  If possible, identify a breach that occurred in, or otherwise impacted, the Middle East.  Review and anal ...

Disscussion questionsneed a paragraphs on each

Disscussion Questions Need a Paragraphs on each question Choosing a Power Supply Choosing a Motherboard Name the 9 major parts of the motherboard and describe it purpose Your group has been asked to present to a high sch ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen