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

answer them all please uestion SM08 sets to null each array location that oz. Wr

ID: 3910239 • Letter: A

Question

answer them all please

uestion SM08 sets to null each array location that oz. Write an implementation of clear that 93. Write an implementation of clear that repeatedly calls pop until the stack is 94. Discuss the advantages and disadvantages of an array-based implementation 95. Consider the ADT bag, as described in Chapters 1 through 3 was used for the stack empty. of the ADT stack as compared to a linked implementation a. Would you be able to implement the ADT stack by using a bag to contain its entries? Justify your answer. b. Would you be able to implement the ADT bag by using a its entries? Justify your answer. 96. Suppose that the ADT stack included the void method display, which displays the entries in a stack. Implement this method for each of the following classes: (LinkedStack- ArrayStack) 97. define the method toArray instead of the method display. Implement this method for each of the following classes:(LinkedStack- ArrayStack). 98. Suppose that the ADT stack included a void method remove(n) that removes the topmost n entries from a stack. Specify this method by writing comments and a header. Consider the possible outcomes for stacks that do not contain n entries. Answer "True" or "False" 99. A stack has at least these three operations: peek, pop, push. 100. A stack has two accéss points: front and back. 101. We use an abstract class to specify the operations of a stack. 102. The array implémentation of a stack is superior to the linked list implementation because the array implementation's pop is faster larger array for the data. current size and its capacity. 103. The árray implementation is inferior because we may have to recreate a 104. The linked list implementation requires that an object keep track of both its

Explanation / Answer

Hello,

Considering your doubt is from 99 to 104:

99. False , Because push and pop are the two main principle operation in a stack

100.False, stack uses LIFO principle ie Last element will be poped first. so only back of the stack(Top) will be used.

101.True, we normally use abstract class to specify the operations of stack

102.True, Because pop operation takes O(1) in array implementation. (Considering pop operation)

103. True, Since array has static memory, whereas linked list has dynamic memory

104.False, Linked List has dynamic memory so it is not mandatory.

Hope, I have solved your problems.

Thank you :)