Understanding Big O Notation: A Beginner's Guide to Time and Space Complexity