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

Popular rsa modulus sizes are 1024 2048 3072 and 4092 bit1

Popular RSA modulus sizes are 1024, 2048, 3072 and 4092 bit. 1. How many random odd integers do we have to test on average until we expect to find one that is a prime? 2. Derive a simple formula for any arbitrary RSA mod ...

Consider a complex signal composed of a dc term and two

Consider a complex signal composed of a dc term and two complex exponentials Plot each N-point DFT as a function of frequency fk = k/N. (a) Compute and plot the DFT of x[n] using 20 samples (0 ≤ n ≤ 19). From the plot, c ...

Answer each question in 8 paragraphs 4 pages-1 should there

Answer each question in 8 paragraphs (4 pages)- 1) Should there be a single programming language for all programming domains? Please use the concepts that you learned in this class to justify your answer. 2) Suppose that ...

1 why is it important to use a structured systematic method

1. Why is it important to use a structured, systematic method for designing networks? What problems can occur if such methods are not used? 2. Compare and contrast the top-down network design method shown in Figure 1-1 w ...

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 ...

Q1 what are the three techniques to improve performance of

Q.1 What are the three techniques to improve performance of CPU? Q.2 Describe how a cache memory is organized? Q.3 What are the three different approaches are commonly used to enhance the performance of memory? Q.4 Narra ...

Open the rope model from the chemistry and physics section

Open the Rope model from the Chemistry and Physics section of the NetLogo models library. This model simulates a wave moving along a rope. The right end of the rope (shown in blue) is fixed to a wall. The left end of the ...

Design and implement a left and right justification

Design and implement a left and right justification algorithm that inserts extra spaces after the longest word first, then after the second longest word and so on. In your implementation by making certain assumptions, tr ...

A program is to perform two products one is a vector

A program is to perform two products: one is a vector product of two 100-element vectors and the other is the product produced by multiplying the corresponding elements of a 1000 by 1000 element matrix by a scalar consta ...

Design and implement a program that prints pascals

Design and implement a program that prints Pascal's triangle: using a recursive implementation of the binomial coefficients function:

  • 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