The Gateway to Computer Science Excellence
0 votes
61 views
in Programming by (59 points) | 61 views
0
think in terms of cache memory
0
Could you please elaborate your answer?

1 Answer

+1 vote

Pls Pls read the first answer:

 

https://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap

 

I cannot explain as good as the person answering there so i linked it..Waiting for the banhammer 😭

 

Although simply speaking heap and stack both are on Virtual memory and therefore can be on RAM or HDD but stack is easily trackable as only the first element(last entered) is used and removed (simultaneously sometimes). However Heap is assigned randomly as needed, so takes more time to track as address needs to be calculated according to demand. This is not done in Stack as the top of stack is always known and does not need to be calculated.

 

Please verify anyone I do not know how to point to people.

by (331 points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,737 questions
57,391 answers
198,589 comments
105,442 users