Last active
May 2, 2019 16:10
-
-
Save Nader93/c2d13686c81cad656df6a835778609f3 to your computer and use it in GitHub Desktop.
Binary Tree Nodes hackerrank (best solution)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select case | |
when p is null then concat(n, ' Root') | |
when n in (select distinct p from bst) then concat(n, ' Inner') | |
else concat(n, ' Leaf') | |
end | |
from bst | |
order by n asc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment