Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initial commit for pat advanced 1004 using Java #174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Truce-Lee
Copy link

提交PAT Advanced Level Problem 1004 "Counting Leaves"的Java解决方案。此问题涉及使用广度优先搜索(BFS)来计算树的每一层的叶子节点数。

新增Main类,包括:
createTree方法用于根据输入数据建立树结构。
countLeafNodes方法应用BFS统计每层的叶子节点数。
printList方法用于输出结果。

已使用PAT平台的多个测试用例进行验证,确保代码正确处理各种边界情况。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant