Shawngbk / Leecode

Questions of Leecode
0 stars 0 forks source link

199. Binary Tree Right Side View #103

Open Shawngbk opened 7 years ago

Shawngbk commented 7 years ago

用null作为每一层的分隔符,如果队首元素后面的元素是null,则证明他是这一层唯一的元素,加入list。 层次遍历法。遍历到每层最后一个节点时,把其放到结果集中。

/**

Shawngbk commented 7 years ago

Amazon