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
51
24
35
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
11
22
21
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
0 Comments