Skip to content

🏝️ A BFS algorithm for finding islands in a binary graph

Notifications You must be signed in to change notification settings

frankie-esparza/island-finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏝️ Island Finder

A Breadth-First-Search (BFS) algorithm for finding islands in a binary graph (i.e. a matrix of 1's and 0's).

For example: In the binary graph below, the algorithm would find 2 islands:

matrix = [
    [⛰️,⛰️,⛰️,⛰️,💧],
    [💧,⛰️,⛰️,💧,⛰️], 
    [💧,⛰️,⛰️,💧,⛰️]
]

the 1st island: 
    ⛰️,⛰️,⛰️,⛰️
       ⛰️,⛰️ 
       ⛰️,⛰️

the 2nd island: 
       ⛰️
       ⛰️

Running Locally

npm install 
mocha

About

🏝️ A BFS algorithm for finding islands in a binary graph

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published