Search

Binary Tree Nodes

โ€ข
ํ‹€๋ฆผ
SELECT DISTINCT BST.N, CASE WHEN BST.P IS NULL THEN 'Root' WHEN B2.N IS NULL THEN 'Leaf' ELSE 'Inner' END FROM BST LEFT JOIN BST B2 ON BST.N = B2.P ORDER BY BST.N ;
JavaScript
๋ณต์‚ฌ
์ด์œ ๋ฅผ ๋ชจ๋ฅด๊ฒ ์Œ