日期:2014-05-20  浏览次数:20683 次

已知二叉树层次遍历字符串和子节点数,求二叉树
//输入参数为广度优先算法遍历的二叉树字符串LIST,每个节点对应子节点数LIST。 
  // 
  public static TreeNode<String> rebuildFromBFSList(List<String> bfsData, List<Integer> childCounts) 
  { 
  // TODO: your code for part (b) 
  return null; 
  } 



bfsData A B C D E F G 
childCounts 6 4 0 0 2 0 0 


  // A 
  // / \ 
  // B C 
  // / \ 
  // D E 
  // / \ 
  // F G 


示例数据如上图所示,求解,不胜感激。

------解决方案--------------------
不知道是楼主是否想要上面的结果。