You are viewing a single comment's thread. Return to all comments →
SELECT N , CASE WHEN N NOT IN (SELECT P FROM BST WHERE P IS NOT NULL) THEN 'Leaf' WHEN P IS NULL THEN 'Root' ELSE 'Inner' END AS node_type FROM BST ORDER BY N ASC;
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 →