I am not able to understand the output function, please help me out!

I am not able to understand the output function, please help me out!!!

Hello @Deepanshu_garg,

Ques 10:
Observe the following graphs:
image
Once, both the curves intersect they never meet again.
As you can see, the value of O{n^3} >= O(2^n), for n>=10

Ques 13:
You can use master’s theorem:
T(n) = aT(n/b) + f(n) where a >= 1 and b > 1
There are following three cases:

If f(n) = Θ(n^c) where c < Logb(a) then T(n) = Θ(nLogba)

If f(n) = Θ(n^c) where c = Logb(a) then T(n) = Θ((n^c)*(Log n))

If f(n) = Θ(n^c) where c > Logb(a) then T(n) = Θ(f(n))

using case 2:
Aswer is Θ(nlogn)

Hope, this would help.
Give a like, if you are satisfied.

Your code is giving run-time error for the input test cases like:
1 2 3 -1 4 5-1 6 -1 -1 7 8 -1 -1 9 -1 -1 -1 -1
Tree Formed:
_____________1
______2_____________3
____________4,5
______6_____________7
8________________________9
Here:
1,4 and 5 lies on same vertical axis. Thus, only 1 will be printed.
2 and 6 on same. 2 will be printed
3 and 7 is same. 3 will be printed.
Expected Output:
8 2 1 3 9
Your Output:
Run-time error

It is printing the bottom view instead of the top view.
Example 1:
1 2 3 4 5 6 7 -1 -1 -1 -1 -1 -1 -1 -1
Expected Output:
4 2 1 3 7
Your Output:
4 2 6 3 7

Example 2;
1 2 3 4 5 6 -1 -1 -1 -1 -1 -1 -1
Expected Output:
4 2 1 3
Your Output:
4 2 6 3

check this one too

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

Please try to resolve it asap

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.