what are the difference between heap and stackthe


What are the difference between heap and stack?

The Stack is more or less responsible for maintaining track of what's executing into our code or what's been "called". The Heap is less or more responsible for maintain track of our things (our data, well... most of this - we'll get to which later).

Think of the Stack like a series of boxes stacked one onto top of the subsequently. We remain track of what's going on into our application by stacking other box on top every time we call a process (termed as a Frame). We can only utilize what's in the top box onto the stack. While we're completed with the top box (the way is done executing) we throw this away and proceed to use the stuff into the prior box on the top of the stack. The Heap is same accept which its purpose is to hold information as not remain track of execution most of the time, therefore anything in our Heap can be accessed at any time. Along with the Heap, there are no constraints like to what can be accessed as in the stack. The Heap is as the heap of clean laundry onto our bed which we have not taken the time to put away until now - we can grab what we require quickly. The Stack is as the stack of shoe boxes into the closet where we have to take off the top one to find to the one underneath this.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: what are the difference between heap and stackthe
Reference No:- TGS0355810

Expected delivery within 24 Hours