๐ DSA with C – Day 1: Introduction & Setup
๐ DSA with C – Day 1: Introduction & Setup
๐ฏ Goal:
-
Understand what DSA is.
-
Set up your C environment.
-
Write your first C program.
-
Learn about time & space complexity (theory).
-
Practice basic input/output and loops.
๐ง Theory: What is DSA?
-
Data Structures = Ways to organize and store data efficiently.
-
Algorithms = Step-by-step instructions to solve problems.
-
Why DSA matters: Faster apps, better problem-solving, cracking tech interviews.
๐ง Setup for C Programming
-
Install a C compiler:
-
Windows: Use Code::Blocks or install
MinGW
and use VS Code. -
Mac/Linux: Already comes with
gcc
. Use VS Code or terminal.
-
-
Create your first
.c
file.
๐จ๐ป Hello World Program
Compile using:
๐ Time & Space Complexity (Intro)
-
Big O Notation (O(n), O(1), etc.)
-
Example:
-
Loop runs
n
times → O(n) -
Constant statement → O(1)
-
Watch a quick 10 min video or read short notes on Big O notation.
๐งช Practice: Basic C I/O and Loops
Tasks:
-
Take input of two numbers and print their sum.
-
Print numbers from 1 to n using a
for
loop. -
Write a program to find if a number is even or odd.
Example:
๐ Day 1 Summary
-
✅ Installed C
-
✅ Understood what DSA is
-
✅ Learned about time/space complexity
-
✅ Practiced basic C programs
๐ Homework for Day 1:
-
Write a program to find the factorial of a number.
-
Write a program to print a multiplication table.
Comments
Post a Comment