answersLogoWhite

0

How stack was formed?

Updated: 8/9/2023
User Avatar

Wiki User

9y ago

Best Answer

Stacks are primarily used in backtracking algorithms. Any task where elements have to be processed in the reverse order they were encountered requires a stack. Function calls are an example. In order for every function to successfully return to its caller, a stack (known as the function call stack) is utilised. When a function call is made, the return address of the caller is pushed onto the stack and when the function is ready to return, that address is popped from the stack and control returned to the caller.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

One of the applications that I use a stack for is searching through a file system (or a large/complex tree).

stack s;

s.push(start_directory);

while( !s.empty() )

current = s.pop();

s.pushAll( current.children );

if( s is what we're looking for )

exit();

// otherwise, keep looping

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

The formation of stacks begins when the sea attacks small cracks in a headland, which causes them to open. The cracks gradually become larger and turn into small caves. Eventually an arch forms and collapses, leaving a pillar of rock (or stack) standing away from the coast.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

the two applications of stack are 1) towers of hanoi 2)recurrsion 3)conversion of expression the two applications of stack are 1) towers of hanoi 2)recurrsion 3)conversion of expression

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Anywhere you need to provide backtracking.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

Storing data by FIFO principle.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How stack was formed?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

When was short stack formed?

they were formed in 2005 :D


How is a natural stack formed?

It is formed by pure gypsum.


How was short stack formed?

Short stack formed when they were all in a train and met and they caused alot of mischief then. ^false


What year was short stack formed?

2005.


What year did short stack get signed?

they formed in 2003 signed 2005


What is formed when waves cut completely through a headline?

Sea stack


A tall narrow rock formed wave erosion sounds like knack?

Stack is a tall narrow rock formed from was erosion.


An offshore column of rock that was once part of the mainland is called a?

An offshore column of rock that was once part of the mainland is called a sea stack or stack. It was formed by erosion.


How is a stumps formed?

The sea forms a sea cave which goes into a arch then it goes into a stack and finally when the sea eroded for years a stump is formed


When did the band short stack form?

Most people say that the band formed in 2008 where as the actual band only say that because that when their career REALLY kick started where ive been a short stack fan since late 2006 (: original short stack fans rockk


Landforms created by wave erosion are?

Headland,Sea Cave, Sea Arch, Sea stack,and wave-cut cliff. EXAMPLE WITH SEA ARCH AND SEA STACK: A sea arch is formed when two caves on opposite sides of a headland join. The sea arch collapses when the waves & weathered sediment (rock particles),hit it continuously in which a sea stack is formed. the sea arch is then .eroded and deposited in a new place.


How are stumps formed in the sea?

The sea first forms sea caves then sea arches then sea stacks and finally it forms sea stumps which will eventually disappear.