You are viewing a single comment's thread. Return to all 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
Seems like cookies are disabled on this browser, please enable them to open this website
Binary Tree Nodes
You are viewing a single comment's thread. Return to all comments →