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

Suppose that deborah peter and kathy are the only members

Suppose that Deborah, Peter, and Kathy are the only members of the group proj and that Deborah, Peter, and Elizabeth are the only members of the group exeter. Show how Peter can restrict access to the file design to hims ...

1 in what fraction of all cycles is the data memory used2

1. In what fraction of all cycles is the data memory used? 2. In what fraction of all cycles is the input of the sign-extend circuit needed? What is this circuit doing in cycles in which its input is not needed? 3. When ...

Design and implement a complete program that uses the

Design and implement a complete program that uses the Postfix Calculator ADT to perform various operations extracted from the user. The user enters text-based commands, one per line, that should be performed by the calcu ...

Kernighan and plauger 565 argue a minimalist philosophy of

Kernighan and Plauger [565] argue a minimalist philosophy of tool building. Their thesis is that each program should perform exactly one task, and more complex programs should be formed by combining simpler programs. Dis ...

A train traveling at 72 kmph crosses a platform in 30

A train traveling at 72 kmph crosses a platform in 30 seconds and a man standing on the platform in 18 seconds. What is the length of the platform in meters?

1 a bss id bssid is a 48-bit address assigned to a bss in

1. A BSS ID (BSSID) is a 48-bit address assigned to a BSS in an 802.11 network. Do some research and find what the use of the BSSID is and how BSSIDs are assigned in ad hoc and infrastructure networks. 2. Do some researc ...

Discuss four of the differentiators and also four ramp

Discuss four of the Differentiators and also Four RAMP Components. You  essay should include examples for each differentiator / Ramp component discussed. Submission Instructions: Your completed essay must be submitted as ...

Create a model that has two buttons the first should create

Create a model that has two buttons. The first should create twenty-five turtles and scatter them around the world. The second button, when pressed, should ask each turtle that is to the left of the origin to print its W ...

1 what is the difference between throwing an exception and

1. What is the difference between throwing an exception and catching an exception? 2. What is a checked exception? What is an unchecked exception? Is a NullPointerException checked or unchecked? Which exceptions do you n ...

1 both acls and c-list entries use owners users rather than

1: Both ACLs and C-List entries use "owners" (users) rather than individual processes. Why? 2: Alice can read and write to the file x, can read the file y, and can execute the file z. Bob can read x, can read and write t ...

  • 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