Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

applications of stacks and their uses?

Answer Posted / shreyank

Keeping track of nested invocation calls in a procedural
programming language, such as C/C++.
Each function call results in a new entry being placed into
the program run-time stack. This new
entry contains memory space for local variables (which can
grow dynamically) and for a return
pointer to the instruction in the function that invoked the
current function (caller/callee). As
functions terminate, their stack entry is "popped out," with
the return values written to the proper
location in the caller.
Since nested procedural/ function invocation levels are
entered and exited in LIFO order, a stack
is the most appropriate data structure to handle this
functionality.
Evaluating arithmetic expressions.
Stacks can be used to parse arithmetic expressions and
evaluate them efficiently, as we shall
see as part of this assignment.
To eliminate the need for direct implementation of recursion.
As recursive function calls require a lot of overhead, it is
often the case that recursive algorithms
are "unrolled" into non-recursive ones. Since recursive
calls are entered/exited in LIFO order the
use of stacks to mimic recursion is a natural choice.

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of linked list over an array?

889


What are the advantages of stack?

800


How do you sort in ascending order in arraylist?

827


What is default size of hashmap?

857


List the two important key points of depth first search?

1146


What are the basic data structures?

918


Write an algorithm to show various operations on ordered list and arrays

886


What is binary tree in discrete mathematics?

804


How many types of sorting algorithms are there?

835


What is priority queue in data structure?

972


Describe what is Node in link list? And name the types of Linked Lists?

882


Can a class have a constructor?

874


Does set allow null values?

788


Can arraylist hold duplicates?

863


which notations are used in evaluation of arithmetic expressions using prefix and postfix forms?

964