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#

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 contain " Q ", " A ", " Z ", " X ", " C","n
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
