BFS is a 4 line algorithm that doesn&#x27;t need to be memorized. I wouldn&#x27;t trust a developer who can&#x27;t even reason this out with understanding runtime order complexity.<p><pre><code>  bool bfs(int x) {
    q = new LinkedList&lt;Node&gt;;
    q.push(root)
    while (q.size != 0 &amp;&amp; q.peak() != x);
    return q.size ? true : false;
  }</code></pre>