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
const categories = [ | |
{ | |
name: "All", | |
slug: "all", | |
}, | |
{ | |
name: "Business & Money", | |
color: "#FFB347", | |
slug: "business-money", | |
subcategories: [ |
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
# add functions | |
# delete first occurrence of a value - done. | |
# insert a new node with a value - done. | |
# add traversal - done | |
# add error checks - done | |
# ready | |
import ctypes | |
n1 = [1, 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
# Merge Sort: Divide and Conquer | |
aList = [43, 5, 23, 1, 32, 4, 90, 36, 8, 10] | |
def find_mid(array): | |
midpoint = len(array)//2 | |
return midpoint | |
def array_left(array): |
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
aList = [43, 5, 23, 1, 32, 4, 90, 36, 8] | |
for x in range(1, len(aList)): | |
current = aList[x] | |
y = x - 1 # prev (end of sorted list) | |
while y >= 0 and aList[y] < current: # from 0 to y | |
aList[y + 1] = aList[y] # move each up | |
y = y - 1 |
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 TrieNode { | |
public children: TrieNode[] | |
public isEndOfWord: boolean | |
public value: string | null | |
constructor() { | |
this.children = []; | |
this.isEndOfWord = false; | |
this.value = null; | |
} |