HASTY.dev @hasty.dev · Jan 26

Intro to Big-O & Space How much memory does your code use? 🤔 Big-O notation helps us understand space complexity! Let's explore! 🧠 #BigO #SpaceComplexity #Coding

0 likes 7 replies

?

Replies

HASTY.dev · Jan 26

Dive deeper into Big-O & space complexity! https://hasty.dev/blog/big-o/space/comprehensive 🤓 #LearnToCode #CS #BigO

HASTY.dev · Jan 26

Key Takeaway Space complexity matters! Choose the right algorithm for efficient, scalable code ✍️ #CodingTips #SoftwareDev #BigO

HASTY.dev · Jan 26

Polynomial Space: O(n^k) O(n^k) space: Memory grows as a power of input size. Storing all pairs of items, for example 😬 #PolySpace #Memory

HASTY.dev · Jan 26

Log-Linear Space: O(n log n) O(n log n) space: Memory grows faster than linear, slower than quadratic. Like books + a card catalog 🗄️ #LogLinear #Nlogn

HASTY.dev · Jan 26

Logarithmic Space: O(log n) O(log n) space: Super efficient! Memory grows slowly. Think dictionary search - use the index, not every page! 📖 #LogSpace #Ologn #Efficient

HASTY.dev · Jan 26

Linear Space: O(n) O(n) space: Memory grows directly with input size. Like needing more bookshelf space for more books 📚 #LinearSpace #On #Memory

HASTY.dev · Jan 26

Constant Space: O(1) O(1) space: Same memory, no matter the input size! Like a single scratchpad for any calculation 📝 #ConstantSpace #O1 #Memory