Update README.md

Removed the insert code snippet as it would be a class exercise.
This commit is contained in:
NehaKeshan
2023-10-03 13:44:09 -04:00
committed by GitHub
parent 41443e2899
commit 298852d524

View File

@@ -284,13 +284,17 @@ item.
- If p is a pointer to this node, and x holds the value to be inserted, then the following code will do the insertion.
Draw a picture to illustrate what is happening.
```cpp
Class exercise
```
<!--
```cpp
Node<T> * q = new Node<T>; // create a new node
q -> value = x; // store x in this node
q -> next = p -> next; // make its successor be the current successor of p
p -> next = q; // make p's successor be this new node
```
-->
- Play this [animation](https://jidongxiao.github.io/CSCI1200-DataStructures/animations/lists/insert/index.html) to see how this code snippet works.
- Note: This code will not work if you want to insert x in a new node at the front of the linked list. Why not?