/ Notes

A running technical garden.

Short, practical notes I keep as I learn — idioms, strategies, complexity cheatsheets.

Need continuous some smaller/larger value? Use heap max or min as you need.

Heap
Link →

Best Django REST Framework Views Series Part 1 Part 2 Part 3

PythonDjangoRest Framework
Link →

when you have something circular, most of the time you can have one variableand another can be calculated using size, current value and doing %

QueueStrategyPython
Link →

LRUCache can be implemented - Hashmap + Doubly Linked List - Python Dict/OrderDict - HashMap + List At least I've tested them for fun :p

HashTableLinked ListFAANGPython

(k := next(iter(d)), d.pop(k)) will remove the leftmost (first) item (if it exists) from a dict object. And if you want to remove the right most/recent value from the dict

d.popitem()
Python
Link →

From python 3.7 dict guarantees that order will be kept as they inserted, and popitem will use LIFO order but we need FIFO type system. so we need OrderedDict which have popIten(last = T/F) for this req. One thing, next(iter(dict)) will return the first key of the dict

Python

leetcode problem 287. Find the Duplicate Number has 7 solving approach. WOW!!!

HashTableSortingSearchingTwo PointersBit ManupulationRecursionPython
Link →

Floyd's Hare and Tortoise algorithm best exaplanation video

Linked List
Link →

Floyd's Tortoise and Hare is used to detect linked list cycle.

Linked List
Link →

time.perf_counter() always returns the float value of time in seconds. while pref_counter_ns() always gives the integer value of time in nanoseconds.


t1_start = perf_counter()
t1_stop = perf_counter()
print("Elapsed time:", t1_stop, t1_start)
Python
Link →

Substring a String

  • string[start:end:step]
  • from first string[2:6]
  • last char string[-1]
  • last char by index string[-1]
  • from last string[-5:]
  • first to last string[1:-4]
StringPython
Link →

Amortized time is the way to express the time complexity when an algorithm has the very bad time complexity only once in a while besides the time complexity that happens most of time. Good example would be an ArrayList which is a data structure that contains an array and can be extended.

Python
Link →

Pythonic Time Complexity Wiki

Important to remember

Python
Link →

His posts are really helpful, FAANG tips Link

FAANG
Link →

Started keeping online notes!

Strategy