You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
private DecisionNode getMaxChild(DecisionNode tree)
{
DecisionNode max = null;
int maxCount = 0;
foreach (var child in tree.Branches)
{
if (child.Branches != null)
{
foreach (var node in child.Branches)
{
var list = subsets[node];
if (list.Count > maxCount)
{
max = node;
maxCount = list.Count;
}
}
}
}
return max;
}
If I'm not mistaken, this implementation doesn't achieve the required result; Instead of returning the max child, it returns the max grandchild.
(Also, if I understood the implementation, getMaxChild is never executed on leaves, so the current node always has branches).