DSDoogal Simpsonindoogal.devScaling Profanity Filters: Why I Use Tries for Real-Time ChatTL;DR: When I'm building high-traffic chat systems, a standard list lookup for profanity is too slow because search time grows with the size of the dictionary. I use a Trie (prefix tree) to move to O(1d ago·5 min read
DSDoogal Simpsonindoogal.devWhy Your Linked List Wants to Be a Bloody TreeQuick Answer: A linked list hits a wall when searching because it’s stuck in linear O(n) time. By giving every node two pointers instead of one, you create a Binary Search Tree (BST). This wacky struc1d ago·5 min read
DSDoogal Simpsonindoogal.devWhy the Ring Buffer is the Foundation of High-Performance SystemsTL;DR: Array-based queues are often dismissed due to O(n) shifting costs, but the ring buffer circumvents this by using wrapping head and tail pointers. This design provides O(1) access and superior c3d ago·5 min read
MGMaku Gideoninfreecodecamp.orgHow to Build a Spam Email Detector with Python and Naive Bayes ClassifierEver wondered how Gmail knows that an email promising you $10 million is spam? Or how it catches those "You've won a free iPhone!" messages before they reach your inbox? In this tutorial, you'll build3d ago·15 min read
DSDoogal Simpsonindoogal.devYour Undo Button is Just a Stack of PancakesTL;DR: I implement undo functionality using a Stack data structure because it follows the Last-In-First-Out (LIFO) principle. Each state change is pushed onto the stack. When I trigger an undo, I pop 4d ago·5 min read
ICIshwar Chandra Tiwari | codewithishwarincodewithishwar.hashnode.devWhy Constraints Matter in Problem SolvingMany developers start coding immediately after reading a problem. Strong problem solvers do something different. They pause and analyze the constraints. Constraints often reveal the right approach bef4d ago·2 min read
AAAbstract Algorithmsinabstractalgorithms.devWhat are Hash Tables? Basics ExplainedTLDR: A hash table gives you near-O(1) lookups, inserts, and deletes by using a hash function to map keys to array indices. The tradeoff: collisions (when two keys hash to the same slot) must be handled, and a full hash table must be resized. 📖 Th...5d ago·10 min read
AAAbstract Algorithmsinabstractalgorithms.devUnderstanding Inverted Index and Its Benefits in Software DevelopmentTLDR TLDR: An Inverted Index maps every word to the list of documents containing it — the same structure as the back-of-the-book index. It is the core data structure behind every full-text search engine, including Elasticsearch, Lucene, and PostgreS...5d ago·12 min read
AAAbstract Algorithmsinabstractalgorithms.devHow Bloom Filters Work: The Probabilistic SetTLDR TLDR: A Bloom Filter is a bit array + multiple hash functions that answers "Is X in the set?" in $O(1)$ constant space. It can return false positives (say "yes" when the answer is "no") but never false negatives (never says "no" when the answer...5d ago·12 min read
AAAbstract Algorithmsinabstractalgorithms.devExploring Different Types of Binary TreesTLDR: A Binary Tree has at most 2 children per node, but the shape of the tree determines performance. A Full tree has 0 or 2 children. A Complete tree fills left-to-right. A Perfect tree is a symmetric triangle. A Degenerate tree becomes a linked li...5d ago·10 min read