1
edit
Changes
→Class: IntList, Files [intlist.h, intlist.cpp], Test: 0: Cleaned up list.
=== Class: IntList, Files [intlist.h, intlist.cpp], Test: 0 ===
==== Internal Variables Public Functions ====; IntListNode* _headsize: The Size getter. Const function. Does not receive parameters. Should return number of nodes in list.; head: Head getter. Const function. Returns pointer to head node in list. ; push: Adds a new node to the '''end of the list'''. I'll say that again, '''END OF THE LIST'''. Should Receives an int parameter. The new node's value should be NULL when set to the received int.; pop: Destroys the '''last node in the list is empty'''. I'll say that again, '''LAST NODE IN THE LIST'''. Does not receive any arguments. Does not return anything.; int _sizeclear: The number of elements currently Removes all nodes in the list. Has no effect if the list is empty. Does not accept parameters. Does not return anything.
; int size() constConstructor: Size getterDoes not accept parameters. Returns the current value of the size memberInitializes list to safe empty state.; IntListNode* head() constStandard Assignment Operator: Head getterClears this list of all nodes. Returns Then, refills list with the current value same number of nodes as in the head pointersource list.; void push(int v): Adds a Value of each new node to should equal the '''end value of the list''' holding the value v. Should increment size.; void pop(): Destroys the last corresponding node in the source list. Should do '''NOTHING''' if not alter object in the list is currently emptycase of self-assignment. Should decrement size if a node was destroyed. '''NOTE:''' If return a node was destroyed, make sure that '''ANY POINTERS POINTING TO IT''', that your code has access reference to, are set to NULLthe current object.; void clear()Copy Constructor: Destroys all nodes in the Initializes object to safe state then copies source list. Has no effect if the into current list is currently empty. When this function is finished, head should point Similar to NULL and size should be 0assignment operator.
== Part 2: Templated Linked List ==