Binary Tree Nodes

  • + 0 comments

    Select DISTINCT a.N, CASE WHEN a.P is NULL THEN 'Root' WHEN b.N is NULL THEN 'Leaf' ELSE 'Inner' END From BST a LEFT JOIN BST b on a.N = b.P;