Technology
- CS Algorithms Circle
4 questions
-
0Is dynamic programming just memoised recursion with extra steps?Every dynamic programming problem I have solved, I first solved as a recursion with a cache, and the answer came out identical. The tabulated version then felt like rewriting working code backwards to satisfy a convention. Is there a real difference, or is the bottom up form just a style preference?3 OpenCS Algorithms Circle · 8h ago
-
0If mergesort is O(n log n) always, why is quicksort usually faster?On paper mergesort looks strictly better. It is O(n log n) in every case, while quicksort degrades to O(n²) if the pivots go badly. Yet almost every standard library sort is quicksort or a hybrid built on it. What is the comparison missing?3 OpenCS Algorithms Circle · 8h ago
-
0Why is a hash table lookup called O(1) when collisions exist?Every source says hash table lookup is O(1), then the next paragraph admits that collisions make it O(n) in the worst case. Both cannot be the headline figure. If the worst case really is linear, why is O(1) the number everyone quotes?4 OpenCS Algorithms Circle · 8h ago
-
0Why is binary search O(log n) and not O(n/2)?Binary search halves the list each time, so my first instinct was that it does about n/2 work. I know the answer is log n but I cannot see where the logarithm comes from, and halving once really does remove half the list. What is the quantity that the logarithm is counting?3 OpenCS Algorithms Circle · 8h ago
-
Omar Haddad 65d ago
Modern tech workspace. This is where algorithms get designed, argued about, and occasionally work.
0 0 0 -
Diego Fernández 68d ago
There is something meditative about watching code scroll through a terminal. Just me?
0 0 0 -
Yuki Tanaka 65d agoPostPDFOpen the document
Growth-rates reference (PDF) — tap expand to read. 📄
0 0 0 -
Alex Chen 69d ago
Late night coding session energy. Multiple monitors. One bug. Four hours.
0 0 0 -
Alex Chen 66d agoHash Tables Deep Dive
Hash Tables Deep Dive
Mini-courseHash Tables Deep Dive1 unit · 1 lesson · 3 questionsWhat is the average-case time complexity for lookup in a hash table?0 0 0 -
Alex Chen 67d agoBellman-Ford deserves better
Hot take: Dijkstra is over-taught and Bellman-Ford is under-taught. Yes, Dijkstra is faster. But Bellman-Ford handles negative edges and the relaxation concept is foundational for understanding DP on graphs. Your move, textbooks.
0 0 0 -
Sofia Reyes 71d agoBig-O is lying to you (kinda)
Big-O is an upper bound, not the exact runtime. An $O(n^2)$ algorithm might actually run in $O(n)$ for most inputs. ArrayList.add() is $O(1)$ amortized despite occasional $O(n)$ resizes. Amortized analysis matters more than worst case in practice.
0 0 0 -
Diego Fernández 92d ago💡 Tip Narrate your approach BEFORE you code
In real interviews I lost points coding in silence. Now I say the brute force, its complexity, then the optimization, THEN write. Interviewers grade your thinking, not your typing speed.
7 1 2