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
| insertionSort = (array) => { | |
| for (outer = 1; outer < array.length; outer++) { | |
| for (inner = 0; inner < outer; inner++) { | |
| console.log(array.join(' ')) | |
| if (array[outer] < array[inner]) { | |
| const [element] = array.splice(outer, 1) | |
| array.splice(inner, 0, element) | |
| } | |
| } | |
| } |
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
| bubbleSort = (array) => { | |
| let swapped = false | |
| do { | |
| swapped = false | |
| array.forEach((current, i) => { | |
| console.log(array.join(' ')) | |
| if (current > array[i + 1]) { | |
| const temp = current | |
| console.log(array.join(' ')) | |
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
| breadthFirst(startingNode, neighborVisit) { | |
| const firstNode = this.searchNode(startingNode) | |
| const visitedNode = nodes.reduce((sum, node) => { | |
| sum[node.id] = false | |
| return sum | |
| }, {}) | |
| const queue = queueCreator() | |
| queue.add(firstNode) | |
| while (!queue.empty()) { | |
| const temp = queue.remove() |
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
| queueCreator = () => { | |
| const queue = [] | |
| return { | |
| add(x) { | |
| queue.unshift(x) | |
| }, | |
| remove() { | |
| if (queue.length === 0) { | |
| return undefined | |
| } |
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
| <template> | |
| <div id="app" class="content"> | |
| <router-view/> | |
| </div> | |
| </template> | |
| <script> | |
| export default { | |
| name: 'App' | |
| } |
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
| import Vue from 'vue' | |
| import Router from 'vue-router' | |
| import firebase from 'firebase' | |
| import Comics from '../components/Comics' | |
| import Login from '../components/Login' | |
| import SignUp from '../components/SignUp' | |
| Vue.use(Router) |
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
| <script> | |
| import firebase from 'firebase' | |
| export default { | |
| name: 'signup', | |
| data () { | |
| return { | |
| email: '', | |
| password: '' | |
| } | |
| }, |
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
| <template> | |
| <div class="sign-up"> | |
| <img src="../assets/dc_logo.jpg" width="300px"> | |
| <h3>Create a new account</h3> | |
| <input | |
| v-model="email" | |
| type="text" | |
| class="input" | |
| placeholder="Email" | |
| required> |
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
| <script> | |
| import firebase from 'firebase' | |
| export default { | |
| name: 'login', | |
| data: function() { | |
| return { | |
| email: '', | |
| password: '' | |
| } |
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
| <template> | |
| <div class="login"> | |
| <img src="../assets/dc_logo.jpg" width="300px"> | |
| <h3>DC Comics Rebirth - Covers</h3> | |
| <input | |
| type="text" | |
| v-model="email" | |
| placeholder="Email address" | |
| class="input" | |
| required> |