function AI_trace_tree(nodes,root)
%
% AI_trace_tree - print out decision tree
% Call:
%     AI_trace_tree(nodes,root);
% On input:
%     nodes (structure array): nodes of tree
%     root (scalar): root node index
% On output:
%     print of node values ()
% Custom functions used:
%     none
% Author:
%     T. Henderson, UU, 11/2002
% Method:
%

cur_node = root;
while cur_node ~= 0
   disp('--- Node ---');
   disp(nodes(cur_node).value);
   disp(nodes(cur_node).type);
   for v = 0:length(nodes(cur_node).children)
      disp(nodes(cur_node).children(v+1));
      AI_trace_tree(nodes,cur_node);
   end
end
