answersLogoWhite

0

DEFINITION: A stack is a homogeneous collection of items of any one type, arranged li

nearly with access at one

end only, called the top. This means that data can be added or removed from only the top.

Formally this type of

stack is called a Last In, First Out (LIFO) stack. Data is added to the stack using the Push operation, and removed using the Pop operation.

Representation-

A stack as in a software "pushdown stack" can be represented as an array with a count of how many elements are used.

In JavaScript, you can simply initialize with A=[] and use A.push(newval) and A.pop() For example, type this in your browser's location box up top: javascript:a=[];a.push('i');a.push('h');alert(a.pop()+a.pop())

It puts h and then i on the stack, and then pops them off, in last-in-first-out (LIFO) order, and should say 'hi'.

You can also represent a stack as a tree. An object store contains volatile (non-shared) objects and persistent (shared) objects. Both stacks contain references to objects. Non-algebraic operators act on the query result stack and the object store and affect the environment stack. Query evaluation takes the state of the environment stack and the state of the objects store and puts query results on the query result stack

Three applications of stack are

1) towers of hanoi

2)recurrsion

3)conversion of expression

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you double the capacity of stack in c?

Something like this: before: #define MAXALLOC 256 after: #define MAXALLOC 512


What is a stack section?

A stack section refers to a specific portion of a stack data structure, which operates on a Last In, First Out (LIFO) principle. It typically consists of a collection of elements where the most recently added item is the first to be removed. In programming, a stack section may represent a subset of a larger stack, often used to manage function calls, local variables, or for temporary storage during computation. Understanding stack sections is crucial for debugging and managing memory effectively in various applications.


What is a stack and how do you represent a stack in computer memory also discuss basic operation performed on a stack?

A stack is an abstraction of First-in-last-out, or the last in first out. The basic operations (may bear different names) Push or Add Pop or Next


Is short stack awesome?

Yes! Yes! Yes! Not to mention if you don't like them then you are stranger than the strangest


Define list of operation on stack?

There are 4 main widely used stack operations.Operations:* POP - increase stack pointer and return top element * PUSH - putting element into stack's top * TOP - returns data of top element on stack * LENGTH/SIZE - returns number of elements inside stack For more detailed implementation details, please check web links.


What is stack sampling?

Stack sampling is a process of gathering representative samples of the gases (pollutants) in an industrial smoke stack to determine its composition. The physical environment in a stack is complex and stack sampling involves fair amount of physical modelling to ensure the gases samples represent the average gas composition in the stack. Stack sampling can also by done by passing a beam of light through the stack gases and observing the absorption spectra.


What makes Hirekingdom the ideal platform for finding a MERN Stack Developer work-from-home internship?

Hirekingdom stands out by offering a wide variety of remote MERN Stack Developer internships, allowing you to gain hands-on experience in building full-stack web applications. The platform prioritizes transparency, ensuring detailed job descriptions and secure applications.


Where string is stored on Heap or Stack in java?

A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.A String is treated as an object, meaning there is an object on the heap. Of course, the variable you define is a pointer to the object, and it is stored on the stack.


Represent a stack in c plus plus?

Use a vector with a base class type. Any objects derived from the base class can be pushed and popped from the vector just as you would from a stack.


What is the use of .stack .data in starting lines of 8086 programming?

.STACK reserves bytes in RAM memory for the stack (the place where the processor will keep function calls and parameters)..DATABelow the ".DATA" line you should declare (and optionally define) your variables, so the compiler reserves the corresponding RAM for each of them.Data works differently from stack, as the data segment will keep named values (the variables values) while the stack will not. The stack will grow as needed upto the maximum value defined in the .STACK directive.


How does Riot Stack enhance the performance of software applications?

Riot Stack enhances software application performance by optimizing the way data is stored and accessed, reducing latency and improving overall efficiency.


What is purpose of BP in pointers registers?

The BP register is an index register that allow convenient access to arguments and local variable in the stack frame, because its use automatically selects the stack segment register. It is usually initialized with the value of the stack pointer at some point in the function routine, so that addresses above BP represent arguments and addresses below BP represent local variables.