← 返回 apple 的题目列表Build a Tree and Perform BFS Traversal
类型:online_judge
Problem
Given input data that describes a tree structure, you need to:
Build a tree from the input (you may design/implement the node structure and building logic);
Run BFS (level-order traversal) on the constructed tree;
Output the BFS traversal result as required.
Input
The original prompt did not specify an exact input format (e.g., level-order array, edge list, parent-child pairs, etc.).
Output
The original prompt did not specify the exact output format (e.g., a flat level-order list, grouping by levels, etc.).
Note: The interview recollection is incomplete; the exact I/O specification must be clarified to make this a fully implementable coding question.