Skip to content

Instantly share code, notes, and snippets.

View gosuri's full-sized avatar

Greg Osuri gosuri

View GitHub Profile
@gosuri
gosuri / dfs.asm
Last active September 21, 2016 22:27
Depth-first search (DFS) is an algorithm for traversing or searching a tree, tree structure, or graph. One starts at the root (selecting some node as the root in the graph case) and explores as far as possible along each branch before backtracking. A graph can be represented by its adjacency matrix G, where G[i][j] == 1 if there is an edge betwe…
.data
Graph: .word 0,1,1,0,0,1,1,0,0
.word 1,0,0,0,0,0,0,0,0
.word 1,0,0,0,0,0,0,0,0
.word 0,0,0,0,1,1,0,0,0
.word 0,0,0,1,0,1,1,0,0
.word 1,0,0,1,1,0,0,0,0
.word 1,0,0,0,1,0,0,0,0
.word 0,0,0,0,0,0,0,0,0
.word 0,0,0,0,0,0,0,0,0