Question: C# is the language Create a generic class called LinkedList and implement the singly linked list. Implement the following functions: - In C# Function Name

C# is the language

  • Create a generic class called LinkedList and implement the singly linked list. Implement the following functions: - In C#

Function Name

Function Parameters

Description

Empty

-

Return true if empty else return false.

Size

-

Return the current size of the list.

Insert

Value

Insert the Value at the end of the list.

Insert

Index, Value

Insert the Value at the specified Index. If the Index is out of range then insert the Value at the end of the list.

Remove

Value

Remove all elements that has the same value as Value.

RemoveAt

Index

Remove all elements that has the same index as Index.

RemoveAll

-

Remove all elements from the list.

Search

Value

Return quantity of the elements that has the same value as Value.

Sort

-

Sort the list by an ascending order.

Sort

AscendingOrder

If AscendingOrder is true then Sort the list by an ascending order else sort the list by a descending order.

IndexOf

Value

Return the index of the first element found with an ascending search order that has the same value as Value. If the value is not found return -1

IndexOf

Value, AscendingOrder

Return the index of the first element found with the same value as Value.

If AscendingOrder is true then search with ascending order. Otherwise, search with a descending order.

If the value is not found, return -1

.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!