正在加载图片...
Implementation of Trees One way to implement a tree would be to have in each node,besides its data,a pointer to each child of the node. However,since the number of children per node can vary so greatly and is not known in advance,it might be infeasible to make the children direct links in the data structure,because there would be too much wasted space. The solution is simple:Keep the children of each node in a linked list of tree nodes.Implementation of Trees ◼ One way to implement a tree would be to have in each node, besides its data, a pointer to each child of the node. ◼ However, since the number of children per node can vary so greatly and is not known in advance, it might be infeasible to make the children direct links in the data structure, because there would be too much wasted space. ◼ The solution is simple: Keep the children of each node in a linked list of tree nodes
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有