Unusual stack overflow when inserting nodes in binary tree

寵の児 提交于 2019-11-28 14:28:34

This question has been answered in the CLISP FAQ How do I avoid stack overflow?

In your case the very first suggestion works: after

(setq *print-circle* t)

we get

In Left [(10 (NIL) (NIL))] => In Null [(NIL)] => mid [(5)] => [#1=(5 #1#  (NIL))]

i.e., you are mistakenly creating a circular structure.

PS. You now owe me 10 zorkmids :-)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!