chap non-binary trees val size (af (bfigure dynamic general tree representation with fixed-size arrays for the child pointers (athe general tree (bthe tree representation for each nodethe first field stores the node value while the second field stores the size of the child pointer array spaceand the old space is then returned to free store as an alternative to relying on the system' garbage collectora memory manager for variable size storage units can be implementedas described in section another possibility is to use collection of free listsone for each array sizeas described in section note in figure that the current number of children for each node is stored explicitly in size field the child pointers are stored in an array with size elements another approach that is more flexiblebut which requires more spaceis to store linked list of child pointers with each node as illustrated by figure this implementation is essentially the same as the "list of childrenimplementation of section but with dynamically allocated nodes rather than storing the nodes in an array dynamic "left-child/right-siblingimplementation the "left-child/right-siblingimplementation of section stores fixed number of pointers with each node this can be readily adapted to dynamic implementation in essencewe substitute binary tree for general tree each node of the "left-child/right-siblingimplementation points to two "childrenin new binary tree structure the left child of this new structure is the node' first child in the general tree the right child is the node' right sibling we can easily extend this conversion to forest of general treesbecause the roots of the trees can be considered siblings converting from forest of general trees to single binary tree is illustrated by figure here we simply include links from each node to its right sibling and remove links to all children except the leftmost child figure shows how this might look in an implementation with two pointers at each node