147k views
1 vote
Method: (public SinglyLinkedStack removeMax(SinglyLinkedStack stack) {} removeMax() ) finds and removes the maximum element in a singly linked stack of Integer, and returns the resulting stack.

a. True
b. False

User Miraage
by
5.4k points

1 Answer

5 votes

Answer:

Te answer is "True"

Step-by-step explanation:

Execute a stack using single linked list idea, all the single linked list activities perform dependent on Stack tasks LIFO (last in first out) and with the assistance of that information we will execute a stack using single linked list.

A stack can be handily executed through the single linked list. In stack Usage, a stack contains a top pointer. which is "head" of the stack where pushing and popping things occurs at the top of the list. first node have invalid in connection field and second node interface have first node address in connection field, etc and last node address in "top" pointer.

The primary advantage of using single linked list over arrays is that it is conceivable to executes a stack that can recoil or develop as much varying. In using array will put a limitation to the greatest capacity of the array which can prompt stack overflow.

User Nebil
by
4.7k points