diff --git a/lectures/10_linked_lists/README.md b/lectures/10_linked_lists/README.md index b604e77..c0c9a6a 100644 --- a/lectures/10_linked_lists/README.md +++ b/lectures/10_linked_lists/README.md @@ -295,22 +295,7 @@ points to the first node in the linked list. Note: Removing the first node is an - Write code to remove p, making sure that if p points to the first node that head points to what was the second node and now is the first after p is removed. Draw a picture of each scenario. -## 10.15 Exercise: Singly-Linked List Copy - -Write a recursive function to copy all nodes in a linked list to form an new linked list of nodes with identical structure -and values. Here’s the function prototype: - -```cpp -template void CopyAll(Node* old_head, Node*& new_head) { - - - - - -} -``` - -## 10.16 Exercise: Singly-Linked List Remove All +## 10.15 Exercise: Singly-Linked List Remove All Write a recursive function to delete all nodes in a linked list. Here’s the function prototype: @@ -325,6 +310,22 @@ template void RemoveAll(Node*& head) { } ``` +## 10.16 Exercise: Singly-Linked List Copy + +Write a recursive function to copy all nodes in a linked list to form an new linked list of nodes with identical structure +and values. Here’s the function prototype: + +```cpp +template void CopyAll(Node* old_head, Node*& new_head) { + + + + + +} +``` + +