The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 3 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
1. Double-stackTwo stacks of positive integers are needed, one containing elements with values less than or equal to 1,000 andthe other containing elements with values larger than 1,000. The total number of elements in the small-valuestack and the larger-value stack combined are not more than 200 at any time, but we cannot predict how manyare in each stack. (all of the elements in could be in small-value stack, they could be evenly divided, both stackscould be empty, and so on. ) You have to implement both stacks in one array.a. Write definition for such a double-stack structure.b. Implement the push method; it should store the new item into the correct stack according to its value(compared to 1,000).c. Implement the pop method; there should a choice for selecting a stack from which value would be pop.i.e: on calling pop method user should be promoted for selecting one stack:please select a stack1. small-value stack (value would be less than or equal to 1,000)2. Large-value stack (value would be pop greater then 1,000)d. Implement the isEmpty, isFull methods; for checking stack is empty or full.e. You can also implement other relevant methods.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll