Modify the algorithm from the previous exercise so that it makes use of a rear reference. How does this affect the time complexity of this and the other operations?
What will be an ideal response?
Create a new node containing a reference to the object to be placed on the stack.
Set rear.next to point to the newly created node.
Set rear to point to the newly created node.
Increment the count of elements in the stack.
This algorithm is O(1).
You might also like to view...
Which of the following is a type of identifier for the location of an external subset like the one in the accompanying figure?
A. internal B. undeclared C. qualified D. system
Which function name below is invalid?
A. set Name B. _Calculate Average C. 4_Names D. both B and C
To help choose the best type of chart for your data, use:
A) Recommended Charts. B) styles. C) sparklines. D) trendlines.
These can be used as visual guides when drawing a table
a. Leader lines b. Rulers c. Measuring guides