Write program to do operaretions of stack-push-pop-peek

Assignment Help Data Structure & Algorithms
Reference no: EM1388132

Write down the program which does the basic stack operations:
1. Make the stack
- if stack has not been created yet, go on with th initialization
- if stack exists, output warning message to the user if he/she wants to continue with deletion of data items stored in the stack

2. Push element into the stack
- for array implementation, ensure to check first for full stack before storing data item into stack (output a "stack overflow" message if the stack is full)
- if the stack is not full, output message to user once data item has been properly stored

3. Pop element from the stack
- for both implementations, ensure to check first for empty stack before proceeding with this operation
- output "stack underflow" message if stack is empty
- if the stack is not empty, proceed with deletion and return value of data item to calling function
- output value of data item which was popped out from stack

4. Take peek at top of the stack
- Just tell user what element is on top of stack

5. Show contents of the stack
- although this is not part of stack operations, you require this to check if elements/data items were inserted accurately

Take note that the following user-defined stack functions require to be in your program:
CreateStack
FullStack
EmptyStack
Push
Pop
Peek

Reference no: EM1388132

Questions Cloud

Diagnosis related groups : You work for local hospital, and your manager would like some clarification on diagnosis-related groups (DRGs). Critically discuss Medicare reimbursement in the context of DRGs for reimbursement purposes.
Extracellular biomolecule, agent endocytosed into the cell : Determine an extracellular biomolecule, agent, or nutrient that is endocytosed into the cell?
Probability exactly one voter is a democrat : If two registered voters are selected at random, what is the probability exactly one voter is a democrat?
What is reliability and what is validity : What is reliability? What is validity? Why are they important to successful academic research.
Write program to do operaretions of stack-push-pop-peek : Write down the program which does the basic stack operations: Make the stack. Push element into the stack. Pop element from the stack.
Quality improvement in health care : Critically discuss why there is such an emphasis on clinical quality issues in health care and discuss why clinical care is so important to Continuous Quality Improvement.
The level of ethnocentricity of an international firm : The level of ethnocentricity of an international firm business leader might influence his or her decisions relevant to cross-cultural issues
Chromosome from a single origin of replication : Suppose that the each replication fork moves at a rate of 500 base pairs per second, how long would it take to replicate the E. coli chromosome from a single origin of replication?
Overview of respiratory system : Working in health care industry, a medical professional should be familiar with the different systems in the body. The respiratory system is one such system that you might encounter when working as a medical billing and coding specialist.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd