In C# please- i cant figure out how to word the exception in a linkedlist- like how
Question:
In C# please- i cant figure out how to word the exception in a linkedlist- like how what do i put in the if statement
void AddAfter(T element, T oldElement)
The same as AddAfter(), but adds after the first node found with the specified oldElement
value.
NOTE: We start from the head and move to the tail when searching for oldElement’s
value.
here is the AddAfter() for reference
void AddAfter(T element, int position)
Finds the Node at the position specified and adds a new node after it.
NOTE: The head is position 1.
1. Size: Increases by 1 when a node (containing an element) is added to the LinkedList.
2. Head: Will never change.
3. Tail: May need to be changed, if the position to add after is the size of the list.
4. Exceptions: Throw an error if the position provided is not valid: zero, negative or above the size of the list.
5. Returns: Nothing.