Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

Sorted List Program Part 1 Your team is still working on the software contract that your company won for the United States Department of Defense. The team lead has tasked you with developing a Java...

1 answer below »

Sorted List Program
Part 1
Your team is still working on the software contract that your company won for the United States Department of Defense. The team lead has tasked you with developing a Java program that uses a linked list to insert and remove items. Because you do not have your secret clearance yet, a senior developer will later take your code and modify it for the requirements of the contract.
In this coding assignment you will utilize the Java syntax and techniques you learned while reviewing the required resources for Week 3. You may select appropriate variable names as long as proper Java syntax is used. You will also submit your source code.
Input:
In the input section, utilize Java syntax and techniques to add five items into a list abstract data type (ADT). Select a list for your program. List examples include students, athletes, days of the week, cities, etc. All input can be hard coded into the Java code.
Processing and Output:
In the processing section, after the elements are added to the list ADT, the following processes must be completed in the following order:
· Print out the contents of the original list. (Output)
· Using the list add(int index, E element) method, insert an element of your selection into the specified position in the list. (Processing)
· Print out the updated contents of the list.
· Using the list remove(int index) method, remove an element at the specified position in the list.
· Print out the updated contents of the list.
Your code must include the following as comments:
· Name of program Sorted List Program
· Autho
student’s name Mel Weave
· Course name and number CPT307: Data Structures & Algorithms (INE2206A)
· Instructor’s name Michael Hayden
· Date submitted XXXXXXXXXX
Part 2
In a Word document, explain how you utilized functions of lists in your Java program in a minimum of 200 words. Paste the image of your results and your source code into the document. Submit your Word document to Waypoint for grading. Take a screen shot of the results page and save the image. When you are finished with your Java program, zip the file.
In a Word document, express the various types of algorithms, including searching and sorting used in your Java program in a minimum of 200 words. Paste the image of your results and your source code into the document.
Answered 13 days After Feb 03, 2022

Solution

Manikandan answered on Feb 12 2022
99 Votes
Algorithms:
    An algorithm means a way of solving a specific problem. It takes a set of inputs and produces the desired output. Using this algorithm we can identify the complexity of the program.
Sample algorithm:
    Printing integer a
ay in reverse order.
        
input
        int a
ay[] = {10,20,5,8,15,25,30,28};
        for(int i=a
ay.length-1;i>=0;i--) {
            System.out.print(a
ay[i]+" ");
        }
        
output
        28 30 25 15 8 5 20 10
In programming different types of algorithms are available for sorting and searching elements in the collection framework. Collection means it may be an a
ay, list, set, map, etc.
Sorting algorithms:
    Â           In java, sorting algorithms are used to sort an a
ay, list elements in an effective way. Converting an a
ay from unordered elements to some order may ascending or descending order is called sorting.
           Java has many types of sorting algorithms as follows.
1) Bu
le sort
2) Insertion sort
3) Selection sort
Bu
le sort:
           This sorting will work by swapping the adjacent elements. It will check adjacent elements are inco
ect order or not if not then it will be swapping. This will repeat until the last element.
           The time complexity for this sort is O(n^2), Best case -> O(n), average case & worst case is O(n^2).
    The space complexity for this sort is O(1).
    Example:
    start sort(a
Value)
         for a
ay elements
             if a
Value[i] > a
Value[i+1]
                 swap(a
Value[i], a
Value[i+1])
            end if
         end for
         return a
Value end sort
Insertion sort:
           This sorting will work by Checking a key element of an a
ay with each element. If the first...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here