• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE CS 1998

Question 81

Draw the binary tree with node labels a, b, c, d, e, f and g for which the inorder and postorder traversals result in the following sequences:
Inorder       a f b c d g e
Postorder     a f c g e d b

    Question 82

    What is the result of the following program?
    program side-effect (input, output);
        var x, result: integer;
        function f (var x:integer):integer;
        begin
            x:x+1;f:=x;
        end;
    begin
        x:=5;
        result:=f(x)*f(x);
        writeln(result);
    end;
    
    • 5
    • 25
    • 36
    • 42

    Question 83

    A counting semaphore was initialized to 10. Then 6 P (wait) operations and 4 V (signal) operations were completed on this semaphore. The resulting value of the semaphore is

    • 0

    • 8

    • 10

    • 12

    There are 83 questions to complete.

    Last Updated :
    Take a part in the ongoing discussion