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

Execute algorithm to convert infix into post fix expression, Q. Execute you...

Q. Execute your algorithm to convert the infix expression to the post fix expression with the given infix expression as input Q = [(A + B)/(C + D) ↑ (E / F)]+ (G + H)/ I

Name the five popular hashing functions, Five popular hashing functions are...

Five popular hashing functions are as follows: 1) Division Method 2) Midsquare Method 3) Folding Method 4) Multiplicative method 5) Digit Analysis

Determine about the unreachable code assertion, Determine about the unreach...

Determine about the unreachable code assertion An unreachable code assertion is an assertion that is placed at a point in a program that shouldn't be executed under any circum

Implementation of stack, Before programming a problem solution those employ...

Before programming a problem solution those employees a stack, we have to decide how to represent a stack by using the data structures which exist in our programming language. Stac

Graph, explain the prims''s algorithm with suitable example?

explain the prims''s algorithm with suitable example?

Red-black tree after insertion, The above 3 cases are also considered conve...

The above 3 cases are also considered conversely while the parent of Z is to the right of its own parent. All the different kind of cases can be illustrated through an instance. Le

Algorithm to add an element at the end of linked list, Write an algorithm t...

Write an algorithm to add an element at the end of circular linked list.   Algorithm to Add the Element at the End of Circular Linked List. IINSENDCLL( INFO, LINK, START, A

Sequential search of a list is preferred over binary search, What are the c...

What are the conditions under which sequential search of a list is preferred over binary search? Sequential Search is a preferred over binary search when the list is unordered

Define a tree and list its properties, QUESTION (a) Define a tree and l...

QUESTION (a) Define a tree and list its properties. (b) By showing all your workings, draw the spanning tree for the following graph based on the Breadth-First-Search algori

What is solid modeling, What is Solid modeling Solid modeling is the mo...

What is Solid modeling Solid modeling is the most powerful of the 3-D modeling technique. It provides the user with complete information about the model. Defining an object wit

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