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

1 the dla simple model often winds up with long

1. The DLA Simple model often winds up with long, tendril-like particle traces. Why does this occur? Why does this pattern change when you make the decision to stick or not to stick probabilistically as we did in the sec ...

Create a cloud of turtles half of them one color and half

Create a " cloud " of turtles, half of them one color and half of them another color. Based on a probability have one color of turtles move up and the other color turtles move down. Label the turtles with their WHO numbe ...

1 what do we mean when we say that a link-layer switch can

1. What do we mean when we say that a link-layer switch can filter traffic? Why is filtering important? 2. Which one has more overhead, a switch or a router? Explain your answer. 3. Which one has more overhead, a hub or ...

Assignmentsection 1 algorithm analysisto do well before

Assignment SECTION 1. Algorithm Analysis TO DO WELL: Before you work on this section, write down what W(N) means, and the F(N)s of sorting and searching. 1) What is the purpose of using asymptotic notation such as O, Ome ...

Design and implement an algorithm that will efficiently

Design and implement an algorithm that will efficiently search a given text for a particular keyword or pattern and record the number of times the keyword or pattern is found. Design a main program that calls the procedu ...

1 assume we add a new protocol to the application layer

1. Assume we add a new protocol to the application layer. What changes do we need to make to other layers? 2. Explain which entity provides service and which one receives service in the client-server paradigm. 3. In the ...

Adding new parameters when we added reproduction to the

Adding new parameters When we added reproduction to the Wolf Sheep Simple model, we set two constants in the code. First, reproduction can occur only if the animal has more than 100 units of energy, and second, reproduct ...

1 what is security and information security what is the

1. What is security and information security? What is the difference? 2. It has been stated that security is a continuous process; what are the states in this process? 3. What are the differences between symmetric and as ...

A babysitter charges 250 an hour until 900 pm when the rate

A babysitter charges $2.50 an hour until 9:00 PM when the rate drops to $1.75 an hour (the children are in bed). Write a program that accepts a starting time and ending time in hours and minutes and calculates the total ...

1 identify the five components of a data communications

1. Identify the five components of a data communications system. 2. What are the three criteria necessary for an effective and efficient network? 3. What are the advantages of a multipoint connection over a point-to-poin ...

  • 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