PushS x Pushes a value x into a stack SSolutionIn PushSx Her

Push(S, x). Pushes a value x into a stack S

Solution

In Push(S,x)

Here Stack address is saved in stack pointer(SP) and after Pushing value x onto stack SP may get incremented or decremented depending whether stack growing upwards or downwards.

1) If SP after Push is incremented then stack is growing upwards

2) If SP after Push is decremented then stack is growing downwards.

SP is 4 bytes long (32-bit address) or 8 bytes long(64-bit address)

Hence above statement is TRUE

Push(S, x). Pushes a value x into a stack SSolutionIn Push(S,x) Here Stack address is saved in stack pointer(SP) and after Pushing value x onto stack SP may get

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site