I hereby claim:
- I am fortunee on github.
- I am fortunee (https://keybase.io/fortunee) on keybase.
- I have a public key ASC3YsJqVSRn-c0Zmf-EIWfNmRbamUvNhllvnUNdZeuh2wo
To claim this, I am signing this object:
| // Rule #6 example (arrow functions) | |
| function RuleSix() { | |
| this.value = 'Some value for rule #6'; | |
| this.printValue = () => { | |
| console.log('Rule six value >>>>', this.value); | |
| } | |
| } | |
| const ruleSix = new RuleSix(); | |
| const printRuleSixVal = ruleSix.printValue; |
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * PSEUDOCODE | |
| * - start a for loop | |
| * - store the index of the first item in the array as the current minimum | |
| * - start a second nested for loop which starts iterating from the next item | |
| * - compare each item with the item at the stored minimum index | |
| * - if any item is lower then reassign it to be the stored minimum | |
| * - at the end of the of firt iteration for the second loop | |
| * - then swap the item at stored minimum index with the item at the | |
| * - current iteration of the outer for loop |
| /** | |
| * PSEUDOCODE | |
| * - start a loop that goes from the end to the start of the array; | |
| * - start a second nested loop that goes from the start to the item below the | |
| * - current position of the first loop; | |
| * - compare each item with next item in the array | |
| * - if current item is greater than the next item following it | |
| * - then swap current item with next item | |
| * - check if any swap happend at every complete iteration of the second loop |
| /** | |
| * PSEUDOCODE | |
| * - Break up the array into halves until you have an empty array or array with one element | |
| * - Once you have the smaller sorted arrays, merge those arrays with other sorted arrays until | |
| * - you are back at the full length of the array | |
| * - Once the array has been merged back together return the merged and sorted array | |
| */ | |
| function mergeSort(array) { | |
| if (array.length <= 1) return array; | |
| const middlePoint = Math.floor(array.length / 2); |
| /** | |
| * PSEUDOCODE | |
| * - initialize the left argument to 0 | |
| * - initialize the right argument to array.length | |
| * - use the pivot helper fn to get the pivot index pivot(array, right, left) | |
| * - recursively call the quickSort fn on both the left and right side of the pivot index | |
| * - ONLY if the left is < right index | |
| * - hence base case should be if (left < right) { keep calling quickSort recursively } | |
| * - when done return array | |
| */ |
| function radixSort(nums) { | |
| const maxDigitCount = mostDigits(nums); | |
| for (let k = 0; k < maxDigitCount; k++) { | |
| const digitsBucket = Array.from({ length: 10 }, () => []); | |
| for (let i = 0; i < nums.length; i++) { | |
| const currentNum = nums[i]; | |
| const digit = getDigit(currentNum, k); |
| class Node { | |
| constructor(value) { | |
| this.previous = null; | |
| this.value = value; | |
| this.next = null; | |
| } | |
| } | |
| class DoublyLinkedList { | |
| constructor() { |
| class Node { | |
| constructor(value) { | |
| this.value = value; | |
| this.next = null; | |
| } | |
| } | |
| class singlyLinkedList { | |
| constructor() { | |
| this.length = 0; |
| class Node { | |
| constructor(value) { | |
| this.value = value; | |
| this.next = null; | |
| } | |
| } | |
| class Stack { | |
| constructor() { | |
| this.first = null; |