General Discussions

Stack and Heap Memory

Stack Memory Heap Memory Memory allocated is in LIFO fashion No specific order. Is random. Allocation and de-allocation of memory is automatic Allocation and de-allocation of memory is manual Locality of reference is excellent Locality of reference is adequate Memory allocated is of fixed size and is not flexible Resizing is possible Space is efficiently… Continue reading Stack and Heap Memory

General Discussions

Basic Stack Implementation – C

The C code for basic Stack Implementation can be found here: Stack Code Link

General Discussions

Formal Definition of Stack DS

If you know the definition of stack, then you can go ahead and understand it formally. But before that lets see the operations on Stack: Si. No. Name Description of the Operation 1. PUSH Insert an item into the stack. 2. POP Delete an item from the stack. 3. PEEK Look out for the top… Continue reading Formal Definition of Stack DS

General Discussions

Stacks – Function Call VS Interrupt

Concept: Function calls are typically implemented by an instruction or an instruction sequence (the calling sequence) that pushes certain information on the stack. Calls to interrupt handlers typically begin with the hardware’s interrupt transfer mechanism followed by some instructions to push certain information on the stack. This post presents the difference between the information pushed… Continue reading Stacks – Function Call VS Interrupt

General Discussions

Understanding Stacks (DS)

This post helps in better understanding of stack data structure. Let us consider an array with the name ‘array’ of size ‘n’. You can access any element of the array by specifying the appropriate index. Visualize the picture mentally and this is how probably it should look like:   Let us now understand how an… Continue reading Understanding Stacks (DS)