Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 8 (1 point) Given a stack implemented with an array, which of the follo

ID: 3727621 • Letter: Q

Question

Question 8 (1 point) Given a stack implemented with an array, which of the following is false? 0 The push method must check to make sure there is space in the array before adding a value to the stack. An index value called top is used to keep track of where the top of the stack is located. The next item added to the stack will always be pushed onto the array at position 0 The pop method will need to check whether or not the stack is empty before changing the value of the top index to remove an item from the stack. Save Question 9 (1 point) Which of the following is not part of a linked list implementation of a stack? A Node reference variable that refers to the first node (stack top) in the list A Node reference variable that refers to the last item in the list where items are added to the stack. An array variable to provide storage for the nodes which are in the stack. A Node reference variable that refers to the last item in the list where items are removed from the stack. Save Question 10 (1 point) When a stack implemented with a linked list is empty, the node reference used to keep track of the top of the stack is null O True False

Explanation / Answer

8
C : The next item added to the stack will always be pushed onto the array at position 0,
This is false, When a new item is added, it takes the first unoccupied position in the array. an index value called top is used to keep track of top of the stack

9.
C. An array variable to provide storage for nodes which are in the stack. This is false. in linked list implementation, data is stored in nodes and they are connected using links (pointers)

10. A (TRUE) : When a Linked list implementation of stack is empty, then top of the stack is null since there are no nodes in the stack

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote