summaryrefslogtreecommitdiff
path: root/02-04.md
diff options
context:
space:
mode:
Diffstat (limited to '02-04.md')
-rw-r--r--02-04.md26
1 files changed, 15 insertions, 11 deletions
diff --git a/02-04.md b/02-04.md
index 6f8cf25..96042bb 100644
--- a/02-04.md
+++ b/02-04.md
@@ -135,17 +135,17 @@ void bag::operator +=(const bag& addend){
```
//FUNCTIONS for the linked list toolkit
-std::size_t list_length(const node *head_ptr);
-void list_head_insert(node *& head_ptr, const node::value_type& entry);
-void list_insert(node *previous_ptr, const node::value_type& entry);
-node *list_search(node *head_ptr, const node::value_type& target);
-const node* list_search(const node* head_ptr, const node::value_type& target);
-node *list_locate(node *head_ptr, std::size_t position);
-const node *list_locate(const node *head_ptr, std::size_t position);
-void list_head_remove(node *& head_ptr);
-void list_remove(node *previous_ptr);
-void list_clear(node *& head_ptr);
-void list_copy(const node *source_ptr, node *& head_ptr, node *& tail_ptr);
+std::size_t list_length(const node *head_ptr); //length of the list
+void list_head_insert(node *& head_ptr, const node::value_type& entry); //insert a new head
+void list_insert(node *previous_ptr, const node::value_type& entry); //insert a new node after the given node
+node *list_search(node *head_ptr, const node::value_type& target); //search for a value in the list
+const node* list_search(const node* head_ptr, const node::value_type& target); //search for a node with a certain value in the list
+node *list_locate(node *head_ptr, std::size_t position); //return the nth node in the list
+const node *list_locate(const node *head_ptr, std::size_t position); //const version of previous function
+void list_head_remove(node *& head_ptr); //remove head pointer (head->next becomes the head)
+void list_remove(node *previous_ptr); //remove the pointer after the given pointer
+void list_clear(node *& head_ptr); //remove all nodes in list
+void list_copy(const node *source_ptr, node *& head_ptr, node *& tail_ptr); //create a copy of a given list
```
### Parameters for Linked Lists
@@ -310,3 +310,7 @@ void list_head_insert(node *& head_ptr, const node::value_type& entry){
- The linked list toolkit also provides for inserting a new node elsewhere
- It is easy to remove a node at the front of a list
- The linked list toolkit also provides a function for removing a node elsewhere - you should read about this function and the other functions of the toolkit
+
+---
+
+[02/09 ->](02-09.md)