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
If TreeNode#postordered_each or TreeNode#breadth_each are called without a block to get the enumerators, these enumerators incorrectly enumerate in the same order as TreeNode#preordered_each. If called instead with blocks they enumerate correctly.
Example:
t = Tree::TreeNode.new('1')
t << Tree::TreeNode.new('2') << Tree::TreeNode.new('4')
t << Tree::TreeNode.new('3') << Tree::TreeNode.new('5')
t['3'] << Tree::TreeNode.new('6')
a = []
t.postordered_each {|n| a << n.name}
a # => ["4", "2", "5", "6", "3", "1"](correct postorder)
t.postordered_each.collect {|n| n.name} # => ["1", "2", "4", "3", "5", "6"](that's preorder instead of
postorder)
The text was updated successfully, but these errors were encountered:
If TreeNode#postordered_each or TreeNode#breadth_each are called without a block to get the enumerators, these enumerators incorrectly enumerate in the same order as TreeNode#preordered_each. If called instead with blocks they enumerate correctly.
Example:
t = Tree::TreeNode.new('1')
t << Tree::TreeNode.new('2') << Tree::TreeNode.new('4')
t << Tree::TreeNode.new('3') << Tree::TreeNode.new('5')
t['3'] << Tree::TreeNode.new('6')
a = []
t.postordered_each {|n| a << n.name}
a # => ["4", "2", "5", "6", "3", "1"](correct postorder)
t.postordered_each.collect {|n| n.name} # => ["1", "2", "4", "3", "5", "6"](that's preorder instead of
postorder)
The text was updated successfully, but these errors were encountered: