What type of parameter passing mechanism (call-by-value, call-by-reference, call-by-name, or-by-value result) is the following sequence of actions trying to implement for a procedure call $P (A[i])$ where P (i:integer) is a procedure and A is an integer array?
Is the implementation correct? Explain and correct it if necessary. You are supposed to make only small changes
- Create a new local variable, say z.
- Assign to z the value of A[i].
- Execute the body of P using z for A[i]
Set A[i] to z.