Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
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. Stacks might be represented in the computer in several ways, usually by means of a one-way list or a linear array. Each of the approach has its advantages & disadvantages. Generally a stack is implemented with two essential operations - push & pop. Push means to add an item on to stack. The push algorithm is sown in Figure.
Here, tos is a pointer which indicates the position of top most items into the stack. Stack is represented through the array arr and MAXSTACK represents the maximum possible number of elements into the stack. The pop algorithm is shown in Figure
Step 1: [test out for stack overflow]
if tos >=MAXSTACK
print "Stack is overflow" and exit
Step 2: [Increment the pointer value through one]
tos=tos+1
Step 3: [Add the item]
Step 4: Exit
arr[tos]=value
The pop operation eliminates the topmost item from the stack. After elimination of top most value tos is decremented by 1.
Step 1: [test out whether the stack is empty]
if tos = 0
print "Stack is underflow" and exit
Step 2: [Elimiante the top most item] value=arr[tos] tos=tos-1
Step 3: [Return the item of the stack]
return(value)
Write an assembly program to separate the number of positive numbers and negative numbers from a given series of signed numbers.
Explain the term - Branching There are two common ways of branching: case of ..... otherwise ...... endcase if ..... then ..... else ..... endif case of
Q.1 Write procedures/ Algorithm to insert and delete an element in to array. Q.2. Write an algorithm for binary search. What are the conditions under which sequential search of
Post order traversal: The children of node are visited before the node itself; the root is visited last. Each node is visited after its descendents are visited. Algorithm fo
#questWrite an algorithm for multiplication of two sparse matrices using Linked Lists.ion..
HOW LINKED LIST HEADER WORKS? HOW TO INSERT AND DELETE ELEMENTS IN LINKED LIST?
If a node having two children is deleted from a binary tree, it is replaced by?? Inorder successor
Q. Write down an algorithm to add an element in the end of the circular linked list. A n s . Algo rithm to Add the Element at the End of Circular Linked Lists
Write a program to create a hashed file that stores the records currently in the file " data_2013 ". Records should use the same fixed-length schema given previously, and should ag
Q. Which sorting algorithm can be easily adaptable for singly linked lists? Explain your answer as well. Ans: The simple Insertion sort is sim
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!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd