Skip to content
Related Articles

Related Articles

Improve Article
GATE | GATE CS 1999 | Question 64
  • Last Updated : 10 Oct, 2017

[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

Attention reader! Don’t stop learning now. Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :