Technical Round Aptitude Questions (Programming Logic)

 Technical Round Aptitude Questions (Programming Logic) 

1. Find the max element in the left subtree if the below numbers are inserted into binary search tree

35 24 51 49 28 13 8 27

  1. 51

  2. 24

  3. 35

  4. 28

Left subtree has elements 51 and 49


Ans:- Option A:- 51



2. What is the output of the following pseudo code

    read integer rose = 1, lotus =2;

    rose += lotus = rose

    Print rose

    Print lotus

Options

  1. 11

  2. 22

  3. 21

  4. 12


initially rose =1 lotus=2
lotus = rose So lotus = 1 and rose = 1
rose +=lotus So rose = lotus +rose = 1 +1 =2 lotus = 1
rose =2
lotus =1

Ans:- c) 21


Post a Comment

0 Comments