Programming
February 13, 2024Programming
February 13, 2024Question 9944 – Programming
Consider the following pascal program skeleton:
program sort(…);
var a,x,...;
procedure readarray;
var i,....;
begin
...:=a...
end;
procedure exchange(...);
begin
...:=a...
...:=x...
end;
procedure qsort(...);
var k,v,...;
function partition (...)...;
var i,j,...;
begin
...:=a...
...:=v...
end;
begin
.
.
end;
begin
.
.
end;
Assume that at a given point in time during program execution, following procedures are active: sort, qsort(1,9), qsort(1.3), partition(1,3), exchange(1,3).
Show snapshots of the runtime stack with access links after each of the activations.
Correct Answer: A
Theory Explanation.
