Take your class and its multiple subclasses. Read in a set of s. This set should...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Take your class and its multiple subclasses. Read in a set of s. This set should contain some (but not all) duplicate elements. Store the s in sorted order in a doubly-linked list of s based on the GDLL class from the previous homework. The sort key should have two levels. The first level should be a identifier and the second key should be something else. You may modify the GDLL class as you see fit to help you do this. If you run across an in the set you read from, and that is already in the doubly-linked list, delete that before going on to add/delete later s. Print the doubly-linked list after each addition and deletion. Details: Your input file should be either entered from your main program or a separate text file. I will test with your file in the order you have the s, and I will also permute your inputs to see that it still works. You need to have at least three elements of each subclass in this file/test method. They should not be in sorted order already. Use insertion sort, and sort by moving Nodes containing objects on the linked list. I don't care if you sort high to low or low to high or by some other method. Explain your sort criteria in your compareTo(...) method documentation. When I say that two objects are equal, I mean that they have the same subtype and values of all attributes. I do not mean that they are in the same memory location (so you need to write an equals (...) method). Describe your sort key in comments of the header of the compareTo(...) method. Grading: This program is worth 40 points. 10 points for proper Comparable interface usage and compareTo(...) code 10 points for proper doubly linked list code (including Node class code) 10 points for proper insertion sort 10 points for proper deletion Take your class and its multiple subclasses. Read in a set of s. This set should contain some (but not all) duplicate elements. Store the s in sorted order in a doubly-linked list of s based on the GDLL class from the previous homework. The sort key should have two levels. The first level should be a identifier and the second key should be something else. You may modify the GDLL class as you see fit to help you do this. If you run across an in the set you read from, and that is already in the doubly-linked list, delete that before going on to add/delete later s. Print the doubly-linked list after each addition and deletion. Details: Your input file should be either entered from your main program or a separate text file. I will test with your file in the order you have the s, and I will also permute your inputs to see that it still works. You need to have at least three elements of each subclass in this file/test method. They should not be in sorted order already. Use insertion sort, and sort by moving Nodes containing objects on the linked list. I don't care if you sort high to low or low to high or by some other method. Explain your sort criteria in your compareTo(...) method documentation. When I say that two objects are equal, I mean that they have the same subtype and values of all attributes. I do not mean that they are in the same memory location (so you need to write an equals (...) method). Describe your sort key in comments of the header of the compareTo(...) method. Grading: This program is worth 40 points. 10 points for proper Comparable interface usage and compareTo(...) code 10 points for proper doubly linked list code (including Node class code) 10 points for proper insertion sort 10 points for proper deletion
Expert Answer:
Related Book For
Posted Date:
Students also viewed these databases questions
-
how you intend to use the knowledge you will gain in this course to build a professional coaching business in the future or how you can plan to use it to enhance your current career.
-
Python and most Python libraries are free to download or use, though many users use Python through a paid service. Paid services help IT organizations manage the risks associated with the use of...
-
1. Read the case thoroughly and answer the questions that follow. 2. Use any relevant chapters as a guide to answer the questions. 3. Extra marks will be awarded for concise and clear answers 4....
-
ed The Engine Guys produces specialized engines for "snow climber buses. The company's normal monthly production volume is 2,500 engines, whereas its monthly production capacity is 5,000 engines. The...
-
Study the four accompanying diagrams. Consider the following statements and indicate which diagram matches each statement. Which variable would appear on the horizontal and which on the vertical...
-
Avillion Corporation had a $45,000 debit balance in Accounts receivable and a $3,500 credit balance in Allowance for uncollectibles on December 31, 2014. The company prepared the following aging...
-
What are the typical cash inflows from operating activities? What are the typical cash outflows for operating activities?
-
Stanton Company is planning to produce 2,000 units of product in 2012. Each unit requires 3 pounds of materials at $6 per pound and a half-hour of labor at $14 per hour. The overhead rate is 70% of...
-
Sketch a,b, and c (2) Sketch the graphs of given equations and state their period. Indicate all x and y intercepts. [13pts] (a) y = 2 sin(x + 7/2). [4pts] (b) y = cos(7x) +1. [5pts] (c) y = tan(x/2)....
-
Bicycle sharing exists in a variety of cities around the country. Los Angeles has the Metro Bike Share system. Users pick up a bike from one station, go for a ride, and return the bike to any...
-
Evaluate the following expression using exponential rules Write the result in standard notation 2 4 10 6 8x10 6
-
Q1). Mr. Mohsin has invested Rs. 25,000 at 6% compounded Monthly. What amount would he receive after the expiry of 4 years? Q2). For how many years Mr. Malik should keep Rs.4,000 invested so as to...
-
Explain the process to ensure employees\' rights are not violated.
-
What type of control involves the use of background checks and employee training to ensure that personnel understand and follow security policies and procedures?
-
Describe risks associated when working with virtual teams? What are some areas in which a project manager could improve upon when working with virtual teams? How should a project manager handle and...
-
The preceding paragraph is an illustration of a sample that was taken from the minutes of a meeting that took place in HEWTO. The purpose of the gathering is to talk about Derek, who expressed...
-
ID T4_Q3: Which statement best summarizes the table? 87% of the population aged 6-34 has ever attended school; over 85% of the population has ever attended school regardless of province or age 87% of...
-
How can NAFTA be beneficial to suppliers of Walmart?
-
During 20x7, Wells Corporation reported a net income of $1,338,400. On January 1, Wells had 720,000 shares of common stock outstanding. The company issued an additional 480,000 shares of common stock...
-
Using the corporate tax rate schedule in Table 1, compute the income tax liability for taxable income of (1) $800,000 and (2) $40,000,000. Earnings per Share
-
Refer to the statement of stockholders equity for Kavra Corporation in Exhibit 5 to answer the following questions: (1) At what price per share were the 5,000 shares of common stock sold? (2) What...
Study smarter with the SolutionInn App