Open In App

GATE | GATE CS 1999 | Question 64

Last Updated : 10 Oct, 2017
Improve
Improve
Like Article
Like
Save
Share
Report

[5 Marks question]
Consider the following pascal program skeleton:

program sort(...);
      var a,x,...;
      procedure readarray;
       var i,....;
       begin
                        ...:=a...
       end;
     procedure exchange(...);
       begin
                         ...:=a...
                         ...:=x...
       end;https://www.geeksforgeeks.org/wp-admin/profile.php
     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.


Answer:

Explanation:

Quiz of this Question
Please comment below if you find anything wrong in the above post


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads