You are viewing a single comment's thread. Return to all comments →
select a.n, max( case when b.n is null and c.n is not null then 'Root' when b.n is not null and c.n is null then 'Leaf' else 'Inner' end ) from bst a left join bst b on a.p = b.n left join bst c on c.p = a.n group by a.n order by a.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 →