Menu

[solved]-Using Linked List Implemented Stack Allowed Use Java Pre Built Library Stack Q39012652

Part II John and his little brother Dave were attending one of the local community events. And, they were offered a plastic c

using a linked list implemented stack

not allowed to use java pre built library for stack

Part II John and his little brother Dave were attending one of the local community events. And, they were offered a plastic container of candies which can hold a maximum of ten candies at a time. The candies are stacked one over the other and Dave could only access the candies from its container’s top side. For this assignment, we are assuming that there are five colored candies with five different flavors, yellow (banana), purple (blackberry), red (strawberry), green (green apple) and pink (watermelon). Dave only likes the banana flavor, so he carefully takes out all the candies with banana flavor, one by one, eats them ones, and keeps the others in order minus the banana flavored candies of course. You can assume that the candies have the following initial order inside the container: red, purple, green, pink, yellow, pink, red, yellow, green, yellow. Write an algorithm in a pseudocode to simulate the process described above and to report back on how many banana candies Dave ate and how many candies are left in the plastic container. You may use any of the stack operations defined in the Stack ADT but may not assume any knowledge on how the stack is implemented (i.e. array, linked list, etc…). Show transcribed image text Part II John and his little brother Dave were attending one of the local community events. And, they were offered a plastic container of candies which can hold a maximum of ten candies at a time. The candies are stacked one over the other and Dave could only access the candies from its container’s top side. For this assignment, we are assuming that there are five colored candies with five different flavors, yellow (banana), purple (blackberry), red (strawberry), green (green apple) and pink (watermelon). Dave only likes the banana flavor, so he carefully takes out all the candies with banana flavor, one by one, eats them ones, and keeps the others in order minus the banana flavored candies of course. You can assume that the candies have the following initial order inside the container: red, purple, green, pink, yellow, pink, red, yellow, green, yellow. Write an algorithm in a pseudocode to simulate the process described above and to report back on how many banana candies Dave ate and how many candies are left in the plastic container. You may use any of the stack operations defined in the Stack ADT but may not assume any knowledge on how the stack is implemented (i.e. array, linked list, etc…).

Expert Answer


Answer to using a linked list implemented stack not allowed to use java pre built library for stack… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *