我的代码游记

标签 · 队列

首页

关于

归档

LeetCodeEasy二叉树队列

102.Binary Tree Level Order Traversal(Easy)

Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).给定一个二叉树,返回他的水平层序遍历(从左到右,一层再一层) *  一个对队列的巧妙应用* For example Given binary tree [3,9,20,null,null,15,7].**  3 /   9   20     /      15   7**return its level order traversal as:[ [3], [9,20], [15,7] ] My Solution(Java) Version 1 Time: 3ms:  ..

更多