Binary Tree Nodes

  • + 0 comments

    SELECT N, CASE WHEN P IS NULL THEN 'Root' WHEN N IN (SELECT P FROM BST) THEN 'Inner' ELSE 'Leaf' END AS Type FROM BST ORDER BY N;