Binary Tree Nodes

  • + 0 comments

    select N, CASE WHEN P is null THEN 'Root' WHEN N not in (select P from BST where p is not null) THEN 'Leaf' ELSE 'Inner' END from BST order by N