Skip to content

Instantly share code, notes, and snippets.

@afdon
afdon / categories.ts
Created May 7, 2025 23:10 — forked from AntonioErdeljac/categories.ts
Funroad assets
const categories = [
{
name: "All",
slug: "all",
},
{
name: "Business & Money",
color: "#FFB347",
slug: "business-money",
subcategories: [
@afdon
afdon / linked-list-2-0
Created February 19, 2025 15:33
DSA Linked List in Python
# 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]
@afdon
afdon / merge_sort.py
Created February 11, 2025 00:24
DSA Merge Sort in Python
# 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):
@afdon
afdon / insertion_sort.py
Created February 10, 2025 13:24
DSA Python Insertion Sort
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
@afdon
afdon / Trie_26-07-23.ts
Last active September 25, 2024 11:44
Trie
class TrieNode {
public children: TrieNode[]
public isEndOfWord: boolean
public value: string | null
constructor() {
this.children = [];
this.isEndOfWord = false;
this.value = null;
}