Stack vs. Heap
Stack:
Heap:
Reference Counting vs. Garbage Collection
Reference Counting:
Garbage Collection:
Stack vs. Queue
Stack:
Queue:
Recursion vs. Iteration
Recursion:
Iteration:
Necessity of multithreading
How to fix a memory leak
-use XCode debug memory graph to detect simple retain cycles. It displays all objects currently alive. Purple exclamation mark indicate related leaked objects.
How to fix a laggy list
Tail Recursion
function tailrecsum(x, running_total = 0) {
if (x === 0) {
return running_total;
} else {
return tailrecsum(x - 1, running_total + x);
}
}software licensing