Given a rooted, ordered n-ary tree (each node has a value and an ordered list of children), simulate an observer who starts at the bottom-left, moves upward to the root level while looking to the right, then continues downward to the bottom-right while looking to the left. At each depth during the upward phase, output the leftmost visible node (the first node encountered at that depth when scanning children left-to-right). During the downward phase, at each depth output the rightmost visible node (the first node encountered at that depth when scanning children right-to-left). Concatenate these into one sequence without duplicates (do not repeat the root if already output). Design an algorithm to compute this sequence for any n-ary tree, analyze time and space complexity, provide pseudocode, and discuss edge cases such as a single-node tree and highly unbalanced trees.