Working on assignment. Finally.
|
This week I realized i was actually really behind on my assignments, therefore i will be working on them fully from now on since we’re done with the group reports. Today i got up early (normally) and went down to the Game room to work before lunch. Working down there let me make some actual progress in my LinkedList assignment. When running the code to add a number of variables from another array(as part of the setup for the list) the current code makes the previous node’s value set to the new value as well. I will solve it and post the revised section of code. // if (pv_nodes.size() > 1) tempNode = newNode; Revised: It was actually just a very minor error. // pv_nodes[numbr -1] = tempNode; The variable “numbr” is the value from a previous for loop which goes through the initial array. It is used in this to keep track of what part of the array pv_nodes the number should be added to. I had forgotten to account for how i use the variable inputted into the list differently because of the separate node pn_first. While writing this i also realized that i had been writing a push_back function rather than a push_front. Luckly i can just rename it when i’m done and do the push_front properly. Good thing i noticed before anyone saw. |