java代写|数据结构|data structure-Linked Lists

java代写|数据结构|data structure: 这是一个简单的利用C语言实现链表的操作的project代写

Project: Linked Lists

Overview

For this project you will implement a basic linked and a sorted linked list. Notice that nopublic tests are part of this project as all tests are either release or secret. You mustimplement this project by yourself.

Objectives

This project will allow you practice linked lists and testing.

Grading

  • (20%) Release Tests
  • (53%) Secret Tests
  • (15%) Student Tests
  • (12%) Style

Code Distribution

The project’s code distribution is available downloading the project namedLinkedListsProject from ELMS. The code distribution provides you with the following:

  • listClasses package Where classes implementing linked lists will appear.
  • tests package Where you should place your student tests.

Specifications

  • You are expected to implement two classes: BasicLinkedList andSortedLinkedList.The javadoc describing what you need to implement can be foundat Project Javadoc.
  • The linked list in our project has a head and tail reference. The next link of the lastnode points to null.
  • Methods addToEnd(), getLast(), retrieveLastElement() rely (and must use) the tailreference.
  • The head and tail must be set correctly when list operations update the list.
  • You can use recursion for the implementation of methods.
  • Two methods must be implemented using recursion: getReverseArrayList() andgetReverseList(). You are allowed to add an auxiliary function (only one) during theimplementation of a recursive method. You MAY NOT add any instance variablesnor static variables to support the implementation of a recursive method. If you doyou will lose significant credit.
  • Your code must be efficient. For example, you will lose credit if you perform anunnecessary list traversal(s) during the implementation of a method. You shouldnot use any methods from the Collections class (e.g. sort).
  • If you see in the submit server the error "missing_component", the problem is thatyou are missing a required class. You can also get this error if you are not defininga generic class correctly. For example, your SortedLinkedList class is not beingdefined as expected. It is recommended that you try submiting your project
immediately (if you have not done so yet) so you can identify this problem (your
code may work in Eclipse but not in the submit server).

Requirements

  • Your student tests must include at least a test for each method of each class. Writetests as you develop your code and not at the end; this is the correct approach todevelop student tests. Also, think how you can test your code so it will work withany data set. Hint: For a list, you can try inserting and deleting all the permutationsfor a set of numbers. This kind of hint is what you need to discover for futureprojects (and for your future job) by yourself.
  • If you have a problem with your code and need assistance during office hours, youneed to have a student test(s) that illustrates the problem you are experiencing.See Student Tests for information regarding the implementation of student tests.
  • You may not shared your student tests with other students.
  • The iterator you define may NOT be used to implement other list operations (e.g.,add). The iterator is for users that want to iterate over the list.
  • You need to implement a singly-linked list that relies on a head and tail reference.
  • See Style Guidelines for information regarding style.

Sample Driver

The following driver and associated output provide an idea of the classes you need toimplement.

import listClasses.BasicLinkedList;import listClasses.SortedLinkedList;

public class SampleDriver {

public static void main(String[] args) {BasicLinkedList basicList = newBasicLinkedList();

basicList.addToEnd("Red").addToFront("Yellow").addToFront("Blue");System.out.println("First: " + basicList.getFirst());System.out.println("Last: " + basicList.getLast());System.out.println("Size: " + basicList.getSize());System.out.println("Retrieve First: " +basicList.retrieveFirstElement());System.out.println("Retrieve Last: " +basicList.retrieveLastElement());System.out.println("Removing Red");basicList.remove("Red", String.CASE_INSENSITIVE_ORDER);System.out.print("Iteration: ");for (String entry : basicList) {System.out.print(entry + " ");}

SortedLinkedList sortedList = newSortedLinkedList(String.CASE_INSENSITIVE_ORDER);sortedList.add("Yellow").add("Red");System.out.print("\n\nIteration (for sorted list): ");for (String entry : sortedList) {System.out.print(entry + " ");}sortedList.remove("Red");

System.out.print("\nAfter remove in sorted list first is:");System.out.println(sortedList.getFirst());}}

Output

First: BlueLast: RedSize: 3Retrieve First: BlueRetrieve Last: RedRemoving RedIteration: Yellow

Iteration (for sorted list): Red YellowAfter remove in sorted list first is: Yellow

Submission

  • Submit your project using the "Submit Project" option (available by right clickingon the project folder).

发表评论

电子邮件地址不会被公开。 必填项已用*标注