Skip to content

Instantly share code, notes, and snippets.

View wjohnson1000's full-sized avatar

William Johnson wjohnson1000

View GitHub Profile
@wjohnson1000
wjohnson1000 / bfs_and_dfs.md
Created March 1, 2016 22:12 — forked from bertoort/bfs_and_dfs.md
Breadth First Search And Depth First Search

Breadth First Search

Algorithm for searching graph-like data structures, one level at a time.


Step by Step

  • Start a queue
  • Check current node - if false, mark as visited, continue

Tree

A collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the "children"), with the constraints that no reference is duplicated (a child can only have 1 parent), and none points to the root.


Recursive Definition

  • One node is designated as the root
  • The root node can have many children (nodes)

The "batteries included" SQL query builder.


Objectives

  • Define what a query builder is and what some of the benefits are to using one