STACK is the one of the important data structure in the computer science world .
every one should know , how stack DS is implemented in program .
Lets see the below code
int add(int a ,int b)
{
return a+b ;
}
add(3,5) ;
when add is getting called , we should know ,what is happening internally and what are the information is storing in stack .
If you realize this , then you can understand the risk of using recursive function :)
well, from the above , you can infer , why thread needs separate Stack .
Stack is very simple but from that you can learn more
by the way , Don't think Stack is different memory . It is same as Heap , Both memory (Heap and Stack ) taken from RAM .
Small amount of memory is separated and it is surrounded by the Stack DS .
every one should know , how stack DS is implemented in program .
Lets see the below code
int add(int a ,int b)
{
return a+b ;
}
add(3,5) ;
when add is getting called , we should know ,what is happening internally and what are the information is storing in stack .
If you realize this , then you can understand the risk of using recursive function :)
well, from the above , you can infer , why thread needs separate Stack .
Stack is very simple but from that you can learn more
by the way , Don't think Stack is different memory . It is same as Heap , Both memory (Heap and Stack ) taken from RAM .
Small amount of memory is separated and it is surrounded by the Stack DS .
No comments:
Post a Comment