Binary Tree Nodes

  • + 0 comments

    select distinct cld.N , case when pr.N is null then 'Leaf' when cld.P is null then 'Root' when pr.N is not null then 'Inner' end as node_type from BST cld left join BST pr on cld.N = pr.P order by cld.N