As a self-taught developer, I need to master at least the basics of data structures and algorithms. To achieve this, I'll read the "Algorithms" book (written in Java) and watch the corresponding videos from The Primagen course (in JavaScript). Then, I'll implement the algorithms in both C and Rust. Why C and Rust? Because I'm learning these languages and want to explore how Rust enhances and improves upon C.
I might subscribe to leetcode for a month and post the puzzle solutions here.
- How many steps does it take to execute a program. How will an algorithm performance change as the data increases?
- We drop al constants
- Worst is case is usually the way we measure,
- loop -> linear O(n)
- halving -> O(logN)
- if you half the input at each step, its likely O(logN) or O(NlogN)
- Binary search
low
is always inclusive,High
is always exclusive -> n+1
- Binary search
- Binary search is O(logN)