This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Graph { | |
constructor() { | |
this.adjList = {} | |
} | |
addVertex(vertex) { | |
this.adjList[vertex] = [] | |
} | |
addEdge(vertex1, vertex2) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A Javascript implementation of the stack data structure. | |
* @Param {size} The maxsize of the stack | |
*/ | |
var Stack = (function(size) { | |
let stack = [], | |
MAXSIZE = size || 0; | |
function Stack(size) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A Javascript implementation of the queue data structure. | |
* @Param {size} The maxsize of the queue | |
*/ | |
var Queue = (function(size) { | |
let queue = [], | |
MAXSIZE = size || 0; | |
function Queue(size) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A simple implementation of a Binary Search Tree in javascript. | |
* Author: Steven Byington | |
**/ | |
let BinarySearchTree = (function() { | |
function BinarySearchTree(data) { | |
this.data = data; | |
this.left = null; | |
this.right = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////// | |
// // | |
// Node // | |
// // | |
/////////////////////////////////////////////////// | |
function Node(data, next) { | |
this.data = data; | |
this.next = next; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Smooth Scroll allows the user to apply a scrolling animation to a given element. | |
* | |
* Example: | |
* <div smooth-scroll anchor-smooth-scroll="scrolled" anchor-padding="{top: 25}"></div> | |
* <div id="scrolled"></div> | |
*/ | |
(function() { | |
'use strict'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function emptyObj(object) { | |
if (!isObject(object)) { | |
throw new TypeError(arguments[0] + ' is not of type Object'); | |
} | |
let ret = function(object) { | |
// Loop through object | |
for (let prop in object) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is a basic configuration for setting up Karma to run with Jenkins. It uses PhantomJs as a headless browser, and babel to tranpile es6 to es5. PhantomJs 2.1 | |
* does not currently itilize es6 features. Finally it exports a junit report xml file to be used by Jenkins. | |
/*/ | |
// Dependencies Needed | |
// npm install babel-core, babel-loader babel-polyfill babel-preset-es2015 karma karma-babel-preprocessor karma-html-reporter karma-html2js-preprocessor karma-jasmine karma-junit-reporter phantomjs phantomjs-prebuilt --save-dev | |
// Karma configuration | |
// http://karma-runner.github.io/0.10/config/configuration-file.html |