Size of stack, Data Structure & Algorithms

Assignment Help:

The size of stack was declared as ten. Thus, stack cannot hold more than ten elements. The major operations which can be performed onto a stack are push and pop. However, in a program, we have to provide two more options, namely, show elements & exit. Show elements will display the elements of the stack. In particular case, the user is not interested to carry out any operation onto the stack and would like to get out of the program, and then s/he will choose exit option. It will log the user out of the program. Choice is a variable that will enable the user to choose the option from the push, pop, show elements & exit operations. top points towards the index of the free location in the stack to where the next element can be pushed. Element is the variable that accepts the integer that need to be pushed onto the stack or will hold the top element of the stack which has to be popped from the stack. The array stack can hold at most ten elements. Push & pop will carry out the operations of pushing the element to the stack & popping the element from the stack respectively.


Related Discussions:- Size of stack

Sequential files, Data records are stored in some particular sequence e.g.,...

Data records are stored in some particular sequence e.g., order of arrival value of key field etc. Records of sequential file cannot be randomly accessed i.e., to access the n th

space, What is Space complexity of an algorithm? Explain

What is Space complexity of an algorithm? Explain.

Representation of max-heap sequentially, Q. How do we represent a max-heap ...

Q. How do we represent a max-heap sequentially? Explain by taking a valid   example.         Ans: A max heap is also called as a descending heap, of size n is an almos

Calculus, basic calculation for algorith.

basic calculation for algorith.

Use of asymptotic notation in the study of algorithm, Q. What is the need o...

Q. What is the need of using asymptotic notation in the study of algorithm? Describe the commonly used asymptotic notations and also give their significance.

Project, human resource management project work in c++

human resource management project work in c++

#, write an algorithm to search a particular node in linked list which retu...

write an algorithm to search a particular node in linked list which returns " FOUND" or "NOT FOUND" as outcome.

What is class invariants assertion, What is Class invariants assertion ...

What is Class invariants assertion A class invariant is an assertion which should be true of any class instance before and after calls of its exported operations. Generally

Fifo, give any example of page replacement using fifo and use your own refe...

give any example of page replacement using fifo and use your own reference string

Nonrecursive implementation of a recursive algorithm?, What data structure ...

What data structure would you mostly likely see in a nonrecursive execution of a recursive algorithm? Stack

Write Your Message!

Captcha
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