Logo

Programming-Idioms

History of Idiom 9 > diff from v32 to v33

Edit summary for version 33 by Dirk:
New Lisp implementation by user [Dirk]

Version 32

2019-06-07, 10:22:55

Version 33

2019-09-26, 16:39:19

Idiom #9 Create a Binary Tree data structure

The structure must be recursive because left child and right child are binary trees too. A node has access to children nodes, but not to its parent.

Idiom #9 Create a Binary Tree data structure

The structure must be recursive because left child and right child are binary trees too. A node has access to children nodes, but not to its parent.

Code
(defclass node ()
  ((value :initarg :value :initform nil :accessor node-value)
   (left-child :initarg :left-child :initform nil :accessor node-left-child)
   (right-child :initarg :right-child :initform nil :accessor node-right-child)))
Doc URL
http://www.lispworks.com/documentation/lw70/CLHS/Body/m_defcla.htm#defclass