Algorithms Refresh
March 12, 2025 | Categories: programming algorithmsI have been spending some time refreshing up on Complex Data Structures and Algorithms. Mostly cause I've been playing with GOLang. Really it's the idea on the techniques that you might come across with not only Leetcode style challenges, but it helps with some lower level understanding. I like to approach these concepts whenever I play with a new programming language as you quickly grasp the basic syntax of that language and their built-in Collection libraries.
Typically different languages are not very different with each other in handling these things. Some minor differences might be with something like how Python has splicing of Lists like mylist[1:] to grab the head of a collection or mylist[::-1] to reverse a collection. With something like Java the list is an object with built-in methods to handle such things. A fun challenge is using a language like Scala and working with Pure Functions and it's monadic methods for handling such things. Such as .map() .flatMap() and .filter(). Scala has a pretty powerful collections library too with easy ways to grab the head of a collection or the tail, which makes recursion quite simple to do and maintaining immutability.
1 + rec_func(mylist.head, mylist.tail)
Here is a rough list of order I recommend approaching these:
- Binary Search
- two-pointers
- sliding window
- Decision Trees and Recursion
- Binary Trees
- Backtracking Problems
- Combinatorics
- Dynamic Programming
- Graphs
- DFS - Depth First Searching
- BFS - Breadth First Searching
- Graphs with edge cases, infinite loops, cycle detection, shortest path
- HashMaps
- Counting Frequencies
- Quick lookups (O(1) time complexity)
- Graph Adjacency lists
- Heaps
- Min-Heaps
- Max-Heaps
- K elements efficiently
- Dynamic Programming
- Longest Common Subsequence
- Coin Change
- Classic DP patterns. (Knapsack, LIS, partitioning)
Probably the best study resource I have found for a good refresher is Structy. Alvin is an amazing teacher and the way he splits up the explanations with the solutions makes it easier to first challenge yourself.
I am not against Interview questions regarding Complex Data structures and Algorithms as long as they try and avoid the silly brain teasers. I still highly suggest practicing on some Leet code throughout your career as a way to feed your programming problem solving mind and to build up confidence.