The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Any Help would be great! need in @ hours if possible. Thanks!!
Â
_____________________________________________________________________________________CSC253Advanced C# ProgrammingSummer 2014_____________________________________________________________________________________FINAL EXAM - PROGRAM 2Time Limit: 3 hoursNOTE: IF YOUR PROGRAM DOES NOT COMPILE AND RUN, I CANNOTGIVE YOU CREDIT.IF YOU RUN OUT OF TIME, TURN IN A VERSIONTHAT DOES NOT DO EVERYTHING RIGHT.DO NOT TURN IN APROGRAM THAT DOES NOT COMPILE.Program 2In Section 21.5.2 of the textbook we learn something about the generic classLinkedList.We are going to use theLinkedListclass in this problem.Create a C# console application for sorted linked lists.This project shouldhave two classes: a genericSortedLinkedList<T>class that implements thesorted linked list, and aTestSortedLinkedListclass that uses integers andcharacters to test theSortedLinkedList<T>class.A sorted linked list is a linked list in which all items are always sorted inascending order, i.e., every node in the linked list is smaller than or equal tothe node right after it.For example, the following integer list is sorted: 2, 7,15, 18, 23, 26.The following integer list is not sorted: 5, 2, 7, 1, 16, 21.Similar, the following character list is sorted: A, K, T, X, Z. The followingcharacter list is not sorted: M, B, X, R, T, A.TheSortedLinkedList<T>class is a generic class.Since we need tocompare and sort items in the list, you need to addIComparable<T>interface as its type constraint.That means the values stored in the listmust be something that can be compared to determined order, such as int,double or char, etc.This class must have at least three methods:(1)A parameter-less constructor that creates an empty linked list(2)A void methodPrintListthat displays the nodes in the list(3)A void methodInsert (T newItem)that inserts a new node (withnewItemas its value) to the list.Since this list is always sorted inascending order, you need to write code to insert the new node at theappropriate position in the list.If a node in the list already carries thesame value we are trying to insert, you can insert the new node eitherright before or right after the existing node.
Attachments:
-----------