Data Structure
1. Create an integer array with some random 2-digit numbers. Move these numbers into a singly linked list with the same order. Display the contents of the array
and linked list, respectively. (use P3-1 SingleLinkedList.cs as a reference)
2. Use P3-1 SingleLinkedList.cs as a reference, add an operation for finding the item with largest key in the class LinkedList, and then delete the node. Test it
in the Main method.
(display the largest key, the linked list before and after removing the node with the largest key.
3. Write a program for linked list of Employee records (employee’s ID, empID, is used as key). The program must contain the following operations:
a. Search for an employee (given an employee empID), and return the whole record when it is found.
b. Insert a node (given a new employee record and the empID (preKey) of an employee record who is in front of the new employee in the list.
c. Delete a node (given an employee empID)
d. Append a node (given a new employee record)
e. Remove a node (return the whole removed employee record)
In the Main method, test your program as follows:
• Create an empty linked list.
• Install 5 employee records into the list, and print the whole list from the header.
• Search an employee record by an employee empID, and print the employee record if the employee is found, or print a message when the employee does not exist.
• Insert an employee record to the linked list and print the list to confirm that the new employee record is inserted.
• Delete an employee record and print the list to confirm that the record is deleted.
• Append an employee record (given an employee record), and print the list to confirm that the record is appended to the head.
• Remove an employee record, and print the list to confirm that the record is removed from the head.
Requirement for assignment reports
1. There must be a cover page, including the name, date of the submission and assignment questions.
2. For each programming question, the submission must include a hardcopy as well as a softcopy in case I need to check your code at run. As before, you should
include a running page (screen shot) which shows that the program works for all cases.
3. Add proper comments lines as necessary so that the instructors can read and understand the program.
class Employee
{
public string name;
public int empID;
public double salary;
public void Input()
{
Console.Write(“Name: “);
name = Console.ReadLine();
Console.Write(“ID: “);
empID = int.Parse(Console.ReadLine());
Console.Write(“Salary: “);
salary = double.Parse(Console.ReadLine());
}
public Output()
{
Console.WriteLine(“[{0}|{1}|{2:C}]”, name, empID, salary);
}
public override string ToString()
{
return string.Format (“[{0}|{1}|{2:C}]”, name, empID, salary);
}
}
FOR YOUR ASSIGNMENTS TO BE DONE AT A CHEAPER PRICE PLACE THIS ORDER OR A SIMILAR ORDER WITH US NOW