***************************************************************************** * www.FindStat.org - The Combinatorial Statistic Finder * * * * Copyright (C) 2019 The FindStatCrew * * * * This information is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * ***************************************************************************** ----------------------------------------------------------------------------- Statistic identifier: St000328 ----------------------------------------------------------------------------- Collection: Ordered trees ----------------------------------------------------------------------------- Description: The maximum number of child nodes in a tree. ----------------------------------------------------------------------------- References: ----------------------------------------------------------------------------- Code: def statistic(t): nodes = [] for node in t: nodes.append(node) maxNode = 0 if (len(nodes) > 0): for node in nodes: tempMax = statistic(node) if(tempMax > maxNode): maxNode = tempMax if (len(nodes) > maxNode): return len(nodes) else: return maxNode ----------------------------------------------------------------------------- Statistic values: [[]] => 1 [[],[]] => 2 [[[]]] => 1 [[],[],[]] => 3 [[],[[]]] => 2 [[[]],[]] => 2 [[[],[]]] => 2 [[[[]]]] => 1 [[],[],[],[]] => 4 [[],[],[[]]] => 3 [[],[[]],[]] => 3 [[],[[],[]]] => 2 [[],[[[]]]] => 2 [[[]],[],[]] => 3 [[[]],[[]]] => 2 [[[],[]],[]] => 2 [[[[]]],[]] => 2 [[[],[],[]]] => 3 [[[],[[]]]] => 2 [[[[]],[]]] => 2 [[[[],[]]]] => 2 [[[[[]]]]] => 1 [[],[],[],[],[]] => 5 [[],[],[],[[]]] => 4 [[],[],[[]],[]] => 4 [[],[],[[],[]]] => 3 [[],[],[[[]]]] => 3 [[],[[]],[],[]] => 4 [[],[[]],[[]]] => 3 [[],[[],[]],[]] => 3 [[],[[[]]],[]] => 3 [[],[[],[],[]]] => 3 [[],[[],[[]]]] => 2 [[],[[[]],[]]] => 2 [[],[[[],[]]]] => 2 [[],[[[[]]]]] => 2 [[[]],[],[],[]] => 4 [[[]],[],[[]]] => 3 [[[]],[[]],[]] => 3 [[[]],[[],[]]] => 2 [[[]],[[[]]]] => 2 [[[],[]],[],[]] => 3 [[[[]]],[],[]] => 3 [[[],[]],[[]]] => 2 [[[[]]],[[]]] => 2 [[[],[],[]],[]] => 3 [[[],[[]]],[]] => 2 [[[[]],[]],[]] => 2 [[[[],[]]],[]] => 2 [[[[[]]]],[]] => 2 [[[],[],[],[]]] => 4 [[[],[],[[]]]] => 3 [[[],[[]],[]]] => 3 [[[],[[],[]]]] => 2 [[[],[[[]]]]] => 2 [[[[]],[],[]]] => 3 [[[[]],[[]]]] => 2 [[[[],[]],[]]] => 2 [[[[[]]],[]]] => 2 [[[[],[],[]]]] => 3 [[[[],[[]]]]] => 2 [[[[[]],[]]]] => 2 [[[[[],[]]]]] => 2 [[[[[[]]]]]] => 1 [[],[],[],[],[],[]] => 6 [[],[],[],[],[[]]] => 5 [[],[],[],[[]],[]] => 5 [[],[],[],[[],[]]] => 4 [[],[],[],[[[]]]] => 4 [[],[],[[]],[],[]] => 5 [[],[],[[]],[[]]] => 4 [[],[],[[],[]],[]] => 4 [[],[],[[[]]],[]] => 4 [[],[],[[],[],[]]] => 3 [[],[],[[],[[]]]] => 3 [[],[],[[[]],[]]] => 3 [[],[],[[[],[]]]] => 3 [[],[],[[[[]]]]] => 3 [[],[[]],[],[],[]] => 5 [[],[[]],[],[[]]] => 4 [[],[[]],[[]],[]] => 4 [[],[[]],[[],[]]] => 3 [[],[[]],[[[]]]] => 3 [[],[[],[]],[],[]] => 4 [[],[[[]]],[],[]] => 4 [[],[[],[]],[[]]] => 3 [[],[[[]]],[[]]] => 3 [[],[[],[],[]],[]] => 3 [[],[[],[[]]],[]] => 3 [[],[[[]],[]],[]] => 3 [[],[[[],[]]],[]] => 3 [[],[[[[]]]],[]] => 3 [[],[[],[],[],[]]] => 4 [[],[[],[],[[]]]] => 3 [[],[[],[[]],[]]] => 3 [[],[[],[[],[]]]] => 2 [[],[[],[[[]]]]] => 2 [[],[[[]],[],[]]] => 3 [[],[[[]],[[]]]] => 2 [[],[[[],[]],[]]] => 2 [[],[[[[]]],[]]] => 2 [[],[[[],[],[]]]] => 3 [[],[[[],[[]]]]] => 2 [[],[[[[]],[]]]] => 2 [[],[[[[],[]]]]] => 2 [[],[[[[[]]]]]] => 2 [[[]],[],[],[],[]] => 5 [[[]],[],[],[[]]] => 4 [[[]],[],[[]],[]] => 4 [[[]],[],[[],[]]] => 3 [[[]],[],[[[]]]] => 3 [[[]],[[]],[],[]] => 4 [[[]],[[]],[[]]] => 3 [[[]],[[],[]],[]] => 3 [[[]],[[[]]],[]] => 3 [[[]],[[],[],[]]] => 3 [[[]],[[],[[]]]] => 2 [[[]],[[[]],[]]] => 2 [[[]],[[[],[]]]] => 2 [[[]],[[[[]]]]] => 2 [[[],[]],[],[],[]] => 4 [[[[]]],[],[],[]] => 4 [[[],[]],[],[[]]] => 3 [[[[]]],[],[[]]] => 3 [[[],[]],[[]],[]] => 3 [[[[]]],[[]],[]] => 3 [[[],[]],[[],[]]] => 2 [[[],[]],[[[]]]] => 2 [[[[]]],[[],[]]] => 2 [[[[]]],[[[]]]] => 2 [[[],[],[]],[],[]] => 3 [[[],[[]]],[],[]] => 3 [[[[]],[]],[],[]] => 3 [[[[],[]]],[],[]] => 3 [[[[[]]]],[],[]] => 3 [[[],[],[]],[[]]] => 3 [[[],[[]]],[[]]] => 2 [[[[]],[]],[[]]] => 2 [[[[],[]]],[[]]] => 2 [[[[[]]]],[[]]] => 2 [[[],[],[],[]],[]] => 4 [[[],[],[[]]],[]] => 3 [[[],[[]],[]],[]] => 3 [[[],[[],[]]],[]] => 2 [[[],[[[]]]],[]] => 2 [[[[]],[],[]],[]] => 3 [[[[]],[[]]],[]] => 2 [[[[],[]],[]],[]] => 2 [[[[[]]],[]],[]] => 2 [[[[],[],[]]],[]] => 3 [[[[],[[]]]],[]] => 2 [[[[[]],[]]],[]] => 2 [[[[[],[]]]],[]] => 2 [[[[[[]]]]],[]] => 2 [[[],[],[],[],[]]] => 5 [[[],[],[],[[]]]] => 4 [[[],[],[[]],[]]] => 4 [[[],[],[[],[]]]] => 3 [[[],[],[[[]]]]] => 3 [[[],[[]],[],[]]] => 4 [[[],[[]],[[]]]] => 3 [[[],[[],[]],[]]] => 3 [[[],[[[]]],[]]] => 3 [[[],[[],[],[]]]] => 3 [[[],[[],[[]]]]] => 2 [[[],[[[]],[]]]] => 2 [[[],[[[],[]]]]] => 2 [[[],[[[[]]]]]] => 2 [[[[]],[],[],[]]] => 4 [[[[]],[],[[]]]] => 3 [[[[]],[[]],[]]] => 3 [[[[]],[[],[]]]] => 2 [[[[]],[[[]]]]] => 2 [[[[],[]],[],[]]] => 3 [[[[[]]],[],[]]] => 3 [[[[],[]],[[]]]] => 2 [[[[[]]],[[]]]] => 2 [[[[],[],[]],[]]] => 3 [[[[],[[]]],[]]] => 2 [[[[[]],[]],[]]] => 2 [[[[[],[]]],[]]] => 2 [[[[[[]]]],[]]] => 2 [[[[],[],[],[]]]] => 4 [[[[],[],[[]]]]] => 3 [[[[],[[]],[]]]] => 3 [[[[],[[],[]]]]] => 2 [[[[],[[[]]]]]] => 2 [[[[[]],[],[]]]] => 3 [[[[[]],[[]]]]] => 2 [[[[[],[]],[]]]] => 2 [[[[[[]]],[]]]] => 2 [[[[[],[],[]]]]] => 3 [[[[[],[[]]]]]] => 2 [[[[[[]],[]]]]] => 2 [[[[[[],[]]]]]] => 2 [[[[[[[]]]]]]] => 1 ----------------------------------------------------------------------------- Created: Dec 16, 2015 at 06:18 by Cole Kainz ----------------------------------------------------------------------------- Last Updated: Dec 16, 2015 at 20:14 by Cole Kainz