Data structure & Algorithm
  • Initial page
  • 1212
  • 121231
  • 2.algorithm
    • 2.1.backtracking
      • 2.1.1.連續序列的排列組合(可能會重複)
      • 2.1.3.一串數列中任取n個數字, 總共有幾種組合
      • 2.1.2.一串數列中取n個數字, 共有幾種組合
    • 2.5.Quick sort
    • 2.6.2.6.廣度優先搜尋 (Breadth-first Search)
    • 2.2.Binary Search
    • 2.1.Backtracking
    • 2.4.河內塔 (Tower of Hanoi)
    • 2.7.動態規劃
    • 2.8.深度優先搜尋 (Depth-first Search)
    • 2.7.二分搜尋法
    • 2.3.分治法 (Divide and Conquer)
  • 2.Count and Say
  • 1.Leetcode Algorithm Practice
  • 2-count-and-say
    • c-solution
    • javascript-solution
  • Algorithm
  • 123
Powered by GitBook
On this page
  • 1.Introduction (參考自: http://simonsays-tw.com/web/DFS-BFS/BreadthFirstSearch.html)
  • 2.例子

Was this helpful?

  1. 2.algorithm

2.6.2.6.廣度優先搜尋 (Breadth-first Search)

Previous2.5.Quick sortNext2.2.Binary Search

Last updated 5 years ago

Was this helpful?

1.Introduction (參考自: )

  • 是一種圖形(graph)搜索演算法

  • 從圖的某一節點(vertex, node)開始走訪, 接著走訪此一節點所有相鄰且未拜訪過的節點, 由走訪過的節點繼續進行先廣後深的搜尋

  • 以樹(tree)來說即把同一深度(level)的節點走訪完, 再繼續向下一個深度搜尋, 直到找到目的節點或遍尋全部節點

  • 廣度優先搜尋法屬於盲目搜索(uninformed search)是利用佇列(Queue)來處理

2.例子

請參考

3.3.1.Binary Tree traversal: Level-Order Traversal
http://simonsays-tw.com/web/DFS-BFS/BreadthFirstSearch.html