Question: Q6: If the list data structure did not maintain a data member mysize for the purpose of keeping track of the number of elements contained,

Q6: If the list data structure did not maintain a data member mysize for the purpose of keeping track of the number of elements contained, how could the size of the list still be determined at a comparable cheap cost of O(1)? (a) Return the value of tail - head +1; (b) Iterates though the list nodes from head to tail and count (c) Keep track of the size of the list as values are entered (d) This is not possible. Q6: If the list data structure did not maintain a data member mysize for the purpose of keeping track of the number of elements contained, how could the size of the list still be determined at a comparable cheap cost of O(1)? (a) Return the value of tail - head +1; (b) Iterates though the list nodes from head to tail and count (c) Keep track of the size of the list as values are entered (d) This is not possible
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
