#23 Binary Tree Nodes | HackerRank SQL Solutions #sql #oracle #pivot #hackerrank

preview_player
Показать описание
Please follow us

Thanks for watching us ...
Dev19🖤
Рекомендации по теме
Комментарии
Автор

explained really well, I was able to write query in one shot after understanding from you

vinaypritwani
Автор

Thank you, DEV19. I found it very difficult when I saw it first time. After watching this video I'm able to solve it in the time attempt.

jaldaamol
Автор

select N,
case
when P is null then 'Root'
WHEN N NOT IN (SELECT distinct P FROM BST) THEN 'Leaf'
else 'Inner'
end
from BST order by N;
When I try to use not in it's not working anyone know why? is it because null present in P?

Md_Danish
Автор

I am getting an error using this, I know how to make it right (by removing Not) but why is it not showing the correct answer using this.?I did replace Leaf and Inner, Someone please help.

select N,
Case
When P is NULL then 'Root'
When N in(Select P from BST) then 'Leaf' else 'Inner'
END
from BST
order by N

AmanBedi-syht
Автор

do I need to know the whole concept of binary tree to solve this question????

Abhishek_sag
visit shbcf.ru