Skip to content

Instantly share code, notes, and snippets.

View chadmuro's full-sized avatar

Chad Murobayashi chadmuro

View GitHub Profile
@chadmuro
chadmuro / singlyLinkedList.js
Last active November 16, 2020 02:40
Singly Linked List
class Node {
constructor(val) {
this.val = val;
this.next = null;
}
}
class SinglyLinkedList {
constructor() {
this.head = null;
@chadmuro
chadmuro / singlyLinkedListReverse.js
Created November 19, 2020 01:58
Singly Linked List Reverse
class Node {
constructor(val) {
this.val = val;
this.next = null;
}
}
class SinglyLinkedList {
constructor() {
this.head = null;
@chadmuro
chadmuro / stacks.js
Created November 23, 2020 01:12
Stack
class Node {
constructor(val) {
this.val = val;
this.next = null;
}
}
class Stack {
constructor() {
this.first = null;
@chadmuro
chadmuro / queues.js
Created November 23, 2020 01:16
Queue
class Node {
constructor(val) {
this.val = val;
this.next = null
}
}
class Queue {
constructor() {
this.first = null;
@chadmuro
chadmuro / materialuiTheme.js
Last active November 30, 2020 02:14
Material-UI Color Theme
import React from 'react';
import { createMuiTheme, ThemeProvider, Button } from '@material-ui/core';
const theme = createMuiTheme({
palette: {
primary: {
main: "#006400"
},
secondary: {
main: "#ffa500"
@chadmuro
chadmuro / doublyLinkedList.js
Last active December 1, 2020 10:30
Doubly Linked List
class Node {
constructor(val) {
this.val = val;
this.next = null;
this.prev = null;
}
}
class DoublyLinkedList {
constructor() {
@chadmuro
chadmuro / binarySearchTree.js
Created December 4, 2020 02:14
Binary Search Tree
class Node {
constructor(value) {
this.value = value;
this.left = null;
this.right = null;
}
}
class BinarySearchTree {
constructor() {
@chadmuro
chadmuro / binarySearchTree2.js
Last active December 6, 2020 06:40
Binary Search Tree 2
class Node {
constructor(value) {
this.value = value;
this.left = null;
this.right = null;
}
}
class BinarySearchTree {
constructor() {
@chadmuro
chadmuro / treeTraversal.js
Last active December 16, 2020 02:30
Tree Traversal
class Node {
constructor(value) {
this.value = value;
this.left = null;
this.right = null;
}
}
class BinarySearchTree {
constructor() {
@chadmuro
chadmuro / maxBinaryHeap.js
Last active December 21, 2020 08:51
Max Binary Heap
class MaxBinaryHeap {
constructor() {
this.values = [];
}
// create our insert method which accepts a value
insert(value) {
//push the value into our array
this.values.push(value);