← 返回 google 的题目列表Mode of Trinary Tree
类型:online_judge
Given a trinary tree where left_child.value < root.value, middle_child.value = root.value, and right_child.value > root.value, write a function to find the mode of the tree (the element that appears most frequently). Handle edge cases such as an empty tree or a tree with no duplicates. Additionally, write code to handle a broken tree condition where the hierarchy rules do not apply.