Saturday, September 27, 2014

Binary Tree Level Order Traversal

Problem

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).

Idea

BFS can solve this problem.

Note

  • C++ queue
  • Solution


    No comments:

    Post a Comment