Question: PLEASE WRITE IN C# Add a method to the OurList class that inserts a new value at a specific index in the list. Your method

PLEASE WRITE IN C#

PLEASE WRITE IN C# Add a method to the OurList class that

Add a method to the OurList class that inserts a new value at a specific index in the list. Your method should have two arguments: The desired index, and the value to insert at that index. The list's indices should start at 0 , just like with arrays and the .NET List class. If the requested index is not in the valid range for the list, your method should throw an IndexOutOfRangeException. Note that if the list is empty, it is valid to insert a new value at index 0 , since inserting at index 0 is the same as adding to the beginning of the list. Examples: If the list contains "Atlanta", "Athens", "Milledgeville", "Savannah", then after calling Insert(1, "Augusta") it should contain "Atlanta", "Augusta", "Athens", "Milledgeville", "Savannah" If the list contains 5,8,9,2,1,3, then after calling lnsert(3,12) it should contain 5, 8, 9,12,2,1,3 If the list contains " Q ", " An, " Z ", " X ", " C",, then after calling Insert(5, " S") it should contain " Q ", " A ", " Z ", " X ", " C","n

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!