Counting leaf nodes in hierarchical tree
- by timn
This code fills a tree with values based their depths. But when traversing the tree, I cannot manage to determine the actual number of children. node-cnt is always 0. I've already tried node-parent-cnt but that gives me lots of warnings in Valgrind.
Anyway, is the tree type I've chosen even appropriate for my purpose?
#include <string.h>…