ã³ã¼ããçãããã®ã£ã¦æ¥½ããã§ãããï¼(1)
éãããã¡ã¢ãªãè³æºç°å¢ä¸ã«ããã¦ããã°ã©ãã³ã°ããã¨ããã®ã¯ãä¸äººåã®ããã°ã©ãã«ãªãããã«å¿ è¦ãªéç¨ã ã¨æãããçµã¿è¾¼ã¿ç³»ãããæºå¸¯åã®ãã¼ãã«ä¸çæºãããªãã¨ãã¦ããçµé¨ãã¦ãããã»ããããã ããã
ã¨ããã§ãã³ã¼ã(ã½ã¼ã¹ã³ã¼ã)ãçãããã®ã¯ã©ãã ããï¼
id:tanakh:20051119#p1ã§ãããã£ã¦ããåé¡ãé常ã«é¢ç½ããlispã®Så¼ã§è¡¨ç¾ãããtreeã辿ã£ã¦ãroot nodeããleaf(çµç«¯node)ã¸ã®åãè¨ç®ãããã®ã ãå³å³ã§è¨ãã°ããã®åã¯27,22,26ã¨18ã
ã¡ãªã¿ã«å³å³ã®Så¼ã¯
ã¨è¡¨ç¾ãããããã®åé¡ã§ã¯ãå ¥åã¯æ¨æºå ¥åããä¸ããããå é ã«ãã®åã§ããæ°åãã¤ãã¦ããã°ãyesãã¨æ¨æºåºåã«åºåãã¤ãã¦ããªããã°ãnoãã¨åºåããã
(5 (4 (11 (7 () ()) (2 () ()) ) ()) (8 (13 () ()) (4 () (1 () ()) ) ) )
ä¾)
[å ¥å]
22 (5 (4 (11 (7 () ()) (2 () ()) ) ()) (8 (13 () ()) (4 () (1 () ()) ) ) )[åºå]
yes
ã¾ããå¦çã¯æ¨æºå ¥åããEOFãåãåãã¾ã§ç¶ããªããã°ãªããªãã
ä¾)
[å ¥å]
22 (5(4(11(7()())(2()()))()) (8(13()())(4()(1()()))))
20 (5(4(11(7()())(2()()))()) (8(13()())(4()(1()()))))
10 (3
(2 (4 () () )
(8 () () ) )
(1 (6 () () )
(4 () () ) ) )
5 ()[åºå]
yes
no
yes
no
åé¡æã®ç´¹ä»ãçµãã£ãã¨ããã§ã¾ãã¯åèªãã£ã¬ã³ã¸ãã¦ã¿ã¦æ¬²ããã(ã¤ã¥ã)