From 3b48639ea9cc0855524220befd849d414cd594ba Mon Sep 17 00:00:00 2001 From: NehaKeshan <39170739+NehaKeshan@users.noreply.github.com> Date: Mon, 2 Oct 2023 23:45:59 -0400 Subject: [PATCH] Update README.md rearranged last two functions - LL remove all and copy --- lectures/10_linked_lists/README.md | 33 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 16 deletions(-) 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) { + + + + + +} +``` + +