Skip to content

Instantly share code, notes, and snippets.

View oscarcp777's full-sized avatar

Oscar Caceres Paredes oscarcp777

View GitHub Profile
@burdenless
burdenless / implement_breadth_first_search.js
Created July 2, 2016 05:23
Khan Academy BFS Implementation - Completed ✅
/* A Queue object for queue-like functionality over JavaScript arrays. */
var Queue = function() {
this.items = [];
};
Queue.prototype.enqueue = function(obj) {
this.items.push(obj);
};
Queue.prototype.dequeue = function() {
return this.items.shift();
};