Binary Tree Nodes

  • + 0 comments

    select N, case when P IS NULL then 'Root' when N IN (select distinct P from BST where P is not null) then 'Inner'
    else 'Leaf' end as node_type from BST order by N;