`
wml199039
  • 浏览: 566 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
这种遍历 好像是有个名字的,忘了! 做html编辑器的时候,想到了这样一种算法 算法比较简单,没有采用递归,javascript实现如下,可以轻易转为其他语言   var queue= new Array(); var started = false; var scanned = false; var temp = root; while (temp) { if(!scanned&&temp.firstChild){ temp = temp.firstChild; continue; } queue.push(temp); if(temp ...
Global site tag (gtag.js) - Google Analytics