The outer loop runs for n/2 times and the inner loop runs for logn times, so the time complexity will be n/2*logn = θ(nlogn).
Consider A and B as one child, so no of ways in which 3 children can stand in a line is 3!. Now A and B can stand together in 2! ways. So, total no. of ways in which children can stand such that A and B are always together is 3! * 2! = 6 * 2 = 12.
for Dyz, index should be 5. So, index 6 must be empty. Also 145 will goto index 2.
Q2 is the correct query. Q1 will output all those employees whose salary is higher than salary of all the employees of department 5.
But y is the parent of x does not necessarily gaurantee that x is left child of y. So i think, the answer should be D.
Answer should be D only. Because both options A and B are true, and also option C is true. Besides option D is contradicting with option B, hence option D should be false.