Binary Tree Nodes

  • + 1 comment

    select case when P is null then N || ' Root' when N not in (select distinct P from BST) then N || ' Leaf' else N || ' Inner' end case from BST order by N;

    Could anyone explain why this gives wrong output?