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 quickSort(nums) { | |
// base case | |
if (nums.length <= 1) { | |
return nums; | |
} | |
// grab a pivot | |
const pivot = nums.pop(); | |
// divide |
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 get(object, prop, notFound = undefined) { | |
if (object) { | |
if (prop in object) { | |
return object[prop]; | |
} | |
} | |
return notFound; | |
} | |
function depthFirst(tree, order, isNotSymmetrical, callback) { |
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
// files to queue | |
let filesToProcess = [ | |
'file1', | |
'file2', | |
'file3', | |
'file4', | |
'file5', | |
'file6', | |
'file7', | |
'file8', |
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 Node: | |
def __init__(self, value): | |
self.value = value | |
self.next = None | |
class Queue: | |
def __init__(self): | |
self.head = None |
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 sweepClouds({ skyMap, y, x }) { | |
if (!skyMap[y]) { | |
return; | |
} | |
if (!skyMap[y][x]) { | |
return; | |
} | |
if (skyMap[y][x] === '1') { |
OlderNewer