Saturday, June 28, 2025

๐Ÿš€ DSA with C – Day 3: Bubble Sort & Binary Search

 

๐ŸŽฏ Goal:

  • Learn Bubble Sort and sort arrays.

  • Understand how Binary Search works.

  • Compare Linear vs Binary Search.

  • Practice problems on sorted arrays.


๐Ÿง  Theory

✅ Bubble Sort:

  • Repeatedly compares adjacent elements and swaps them if they’re in the wrong order.

  • Worst-case time complexity: O(n²)

  • Best-case (already sorted): O(n) with optimization


๐Ÿ‘จ‍๐Ÿ’ป Bubble Sort in C


#include <stdio.h> int main() { int arr[100], n, i, j, temp; printf("Enter number of elements: "); scanf("%d", &n); printf("Enter %d elements:\n", n); for (i = 0; i < n; i++) scanf("%d", &arr[i]); // Bubble Sort for (i = 0; i < n - 1; i++) { int swapped = 0; for (j = 0; j < n - i - 1; j++) { if (arr[j] > arr[j + 1]) { // Swap temp = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = temp; swapped = 1; } } if (swapped == 0) break; // Already sorted } printf("Sorted array:\n"); for (i = 0; i < n; i++) printf("%d ", arr[i]); return 0; }

✅ Binary Search:

  • Efficient searching technique on sorted arrays.

  • Time Complexity: O(log n)

  • Repeatedly divide the array and compare with middle element.


๐Ÿ‘จ‍๐Ÿ’ป Binary Search in C


#include <stdio.h> int binarySearch(int arr[], int n, int key) { int low = 0, high = n - 1, mid; while (low <= high) { mid = (low + high) / 2; if (arr[mid] == key) return mid; else if (arr[mid] < key) low = mid + 1; else high = mid - 1; } return -1; // Not found } int main() { int arr[100], n, key; printf("Enter number of elements: "); scanf("%d", &n); printf("Enter %d sorted elements:\n", n); for (int i = 0; i < n; i++) scanf("%d", &arr[i]); printf("Enter element to search: "); scanf("%d", &key); int result = binarySearch(arr, n, key); if (result == -1) printf("Element not found.\n"); else printf("Element found at index %d.\n", result); return 0; }

๐Ÿ” Linear vs Binary Search

FeatureLinear SearchBinary Search
Time ComplexityO(n)O(log n)
Sorted Array Required❌ No✅ Yes
SpeedSlowerFaster for large data
ApproachScan all elementsDivide & Conquer

๐Ÿงช Practice Problems:

  1. Sort an array using Bubble Sort in descending order.

  2. Count how many swaps were done during Bubble Sort.

  3. Use Binary Search to find the number of occurrences of a given element.

  4. If not found in Binary Search, return where it should be inserted.


๐Ÿ“˜ Homework for Day 3:

  • Implement recursive Binary Search.

  • Write a program that first sorts using Bubble Sort and then searches using Binary Search.

  • LeetCode problem suggestion: Search Insert Position


๐Ÿ“… Day 3 Summary

  • ✅ Learned Bubble Sort (with optimization)

  • ✅ Implemented Binary Search (iterative)

  • ✅ Practiced comparing search algorithms

Monday, June 23, 2025

✅ Solution Implement Both Linear and Binary Search Day 3 DSA with Java


๐Ÿ”น Linear Search in Java


public class LinearSearch { public static int linearSearch(int[] arr, int key) { for (int i = 0; i < arr.length; i++) { if (arr[i] == key) return i; } return -1; // Not found } public static void main(String[] args) { int[] arr = {5, 3, 8, 2, 9}; int key = 8; int index = linearSearch(arr, key); System.out.println("Element found at index: " + index); } }

๐Ÿ”น Binary Search in Java (Iterative)


public class BinarySearch { public static int binarySearch(int[] arr, int key) { int start = 0, end = arr.length - 1; while (start <= end) { int mid = start + (end - start) / 2; if (arr[mid] == key) return mid; else if (arr[mid] < key) start = mid + 1; else end = mid - 1; } return -1; } public static void main(String[] args) { int[] arr = {1, 3, 5, 7, 9}; int key = 5; int index = binarySearch(arr, key); System.out.println("Element found at index: " + index); } }

2. LeetCode Problems

๐Ÿ”ธ Search Insert Position

Problem: Return the index if the target is found. If not, return the index where it would be inserted.


public class SearchInsertPosition { public static int searchInsert(int[] nums, int target) { int low = 0, high = nums.length - 1; while (low <= high) { int mid = low + (high - low) / 2; if (nums[mid] == target) return mid; else if (nums[mid] < target) low = mid + 1; else high = mid - 1; } return low; } public static void main(String[] args) { int[] nums = {1, 3, 5, 6}; int target = 2; System.out.println("Insert position: " + searchInsert(nums, target)); } }

๐Ÿ”ธ First Bad Version

Assume isBadVersion(version) API exists.


public class FirstBadVersion { static int bad = 4; // Let's assume version 4 is the first bad version public static boolean isBadVersion(int version) { return version >= bad; } public static int firstBadVersion(int n) { int low = 1, high = n; while (low < high) { int mid = low + (high - low) / 2; if (isBadVersion(mid)) high = mid; else low = mid + 1; } return low; } public static void main(String[] args) { System.out.println("First bad version: " + firstBadVersion(10)); } }

๐ŸŒฑ 3. Explore: Lower Bound & Upper Bound

These are binary search variants often used in competitive programming.

๐Ÿ”ธ Lower Bound (First element ≥ target)


public static int lowerBound(int[] arr, int target) { int low = 0, high = arr.length; while (low < high) { int mid = low + (high - low) / 2; if (arr[mid] < target) low = mid + 1; else high = mid; } return low; // returns the index }

๐Ÿ”ธ Upper Bound (First element > target)


public static int upperBound(int[] arr, int target) { int low = 0, high = arr.length; while (low < high) { int mid = low + (high - low) / 2; if (arr[mid] <= target) low = mid + 1; else high = mid; } return low; // returns the index }

You can test both with:


int[] arr = {1, 3, 3, 5, 7}; System.out.println("Lower Bound of 3: " + lowerBound(arr, 3)); // Output: 1 System.out.println("Upper Bound of 3: " + upperBound(arr, 3)); // Output: 3

๐Ÿš€ Day 3: Searching Algorithms in Java


๐ŸŽฏ Goals:

  • Understand Linear Search and Binary Search

  • Learn when and how to use each

  • Solve real interview problems using searching techniques


๐Ÿ” 1. Linear Search

๐Ÿ“˜ Definition:

Linearly checks each element one by one. Used when the array is unsorted.

✅ Code Example:


public static int linearSearch(int[] arr, int key) { for (int i = 0; i < arr.length; i++) { if (arr[i] == key) return i; } return -1; // Not found }

๐Ÿง  2. Binary Search

๐Ÿ“˜ Definition:

Used on sorted arrays. It divides the search space in half each time — O(log N) time complexity.

✅ Code (Iterative Approach):


public static int binarySearch(int[] arr, int key) { int start = 0, end = arr.length - 1; while (start <= end) { int mid = start + (end - start) / 2; if (arr[mid] == key) return mid; else if (arr[mid] < key) start = mid + 1; else end = mid - 1; } return -1; }

✅ Code (Recursive Approach):


public static int binarySearchRec(int[] arr, int key, int start, int end) { if (start > end) return -1; int mid = start + (end - start) / 2; if (arr[mid] == key) return mid; else if (arr[mid] < key) return binarySearchRec(arr, key, mid + 1, end); else return binarySearchRec(arr, key, start, mid - 1); }

๐Ÿ’ก 3. Binary Search Use Cases

  • Search in sorted array

  • Find first/last occurrence of an element

  • Search in rotated sorted arrays

  • Peak elements in mountain arrays


✍️ 4. Practice Problems

๐Ÿ”น Write functions to:

  • Find first and last occurrence of an element (e.g. in sorted duplicates)

  • Count how many times a number appears in sorted array

  • Search in a rotated sorted array

  • Find square root using binary search (approximate to floor)


๐Ÿ”ฅ 5. BONUS – Search in 2D Matrix

๐Ÿ”น Use binary search logic on 2D:


public static boolean searchMatrix(int[][] matrix, int target) { int rows = matrix.length; int cols = matrix[0].length; int low = 0, high = rows * cols - 1; while (low <= high) { int mid = low + (high - low) / 2; int value = matrix[mid / cols][mid % cols]; if (value == target) return true; else if (value < target) low = mid + 1; else high = mid - 1; } return false; }

๐Ÿ“š Homework for Day 3:


⏭️ What’s Coming on Day 4?

  • Sorting Algorithms: Bubble, Selection, Insertion (with time/space analysis)


๐Ÿงช Practice Problems Answer Day 2 DSA with C

 



✅ 1. Find Maximum and Minimum in an Array


#include <stdio.h> int main() { int n, i; int arr[100], max, min; printf("Enter number of elements: "); scanf("%d", &n); printf("Enter %d elements:\n", n); for (i = 0; i < n; i++) { scanf("%d", &arr[i]); } max = min = arr[0]; for (i = 1; i < n; i++) { if (arr[i] > max) max = arr[i]; if (arr[i] < min) min = arr[i]; } printf("Maximum: %d\n", max); printf("Minimum: %d\n", min); return 0; }

✅ 2. Count Occurrences of a Given Number


#include <stdio.h> int main() { int n, x, count = 0; int arr[100]; printf("Enter number of elements: "); scanf("%d", &n); printf("Enter %d elements:\n", n); for (int i = 0; i < n; i++) { scanf("%d", &arr[i]); } printf("Enter number to count: "); scanf("%d", &x); for (int i = 0; i < n; i++) { if (arr[i] == x) count++; } printf("Number %d appears %d time(s).\n", x, count); return 0; }

✅ 3. Reverse an Array


#include <stdio.h> int main() { int n, arr[100]; printf("Enter number of elements: "); scanf("%d", &n); printf("Enter %d elements:\n", n); for (int i = 0; i < n; i++) { scanf("%d", &arr[i]); } printf("Reversed array:\n"); for (int i = n - 1; i >= 0; i--) { printf("%d ", arr[i]); } return 0; }

๐Ÿ“˜ Homework


✅ 4. Copy One Array to Another


#include <stdio.h> int main() { int n, arr1[100], arr2[100]; printf("Enter number of elements: "); scanf("%d", &n); printf("Enter %d elements for arr1:\n", n); for (int i = 0; i < n; i++) { scanf("%d", &arr1[i]); arr2[i] = arr1[i]; // Copying } printf("Copied array (arr2):\n"); for (int i = 0; i < n; i++) { printf("%d ", arr2[i]); } return 0; }

✅ 5. Merge Two Arrays


#include <stdio.h> int main() { int arr1[50], arr2[50], merged[100]; int n1, n2, i; printf("Enter number of elements in arr1: "); scanf("%d", &n1); printf("Enter %d elements for arr1:\n", n1); for (i = 0; i < n1; i++) scanf("%d", &arr1[i]); printf("Enter number of elements in arr2: "); scanf("%d", &n2); printf("Enter %d elements for arr2:\n", n2); for (i = 0; i < n2; i++) scanf("%d", &arr2[i]); for (i = 0; i < n1; i++) merged[i] = arr1[i]; for (i = 0; i < n2; i++) merged[n1 + i] = arr2[i]; printf("Merged array:\n"); for (i = 0; i < n1 + n2; i++) printf("%d ", merged[i]); return 0; }

๐Ÿš€ DSA with C – Day 2: Arrays & Linear Search

 

๐ŸŽฏ Goal:

  • Understand arrays in C.

  • Learn how to use loops with arrays.

  • Implement Linear Search algorithm.

  • Practice multiple array-based programs.


๐Ÿง  Theory: What is an Array?

  • An array is a collection of elements stored in contiguous memory.

  • All elements must be of the same type.

  • Indexing starts from 0 in C.

๐Ÿ”ง Declaration and Initialization

int arr[5]; // Declaration
int arr[5] = {1, 2, 3, 4, 5}; // Initialization

๐Ÿ‘จ‍๐Ÿ’ป Basic Program: Input & Output in Arrays

#include <stdio.h>
int main() { int arr[5]; printf("Enter 5 numbers:\n"); for (int i = 0; i < 5; i++) { scanf("%d", &arr[i]); } printf("You entered:\n"); for (int i = 0; i < 5; i++) { printf("%d ", arr[i]); } return 0; }

๐Ÿ” Linear Search in C

➕ Problem: Given an array and a number x, find if x exists in the array.

✅ Code:


#include <stdio.h> int main() { int arr[100], n, x, found = 0; printf("Enter number of elements: "); scanf("%d", &n); printf("Enter %d elements:\n", n); for (int i = 0; i < n; i++) scanf("%d", &arr[i]); printf("Enter element to search: "); scanf("%d", &x); for (int i = 0; i < n; i++) { if (arr[i] == x) { printf("Element found at index %d\n", i); found = 1; break; } } if (!found) printf("Element not found\n"); return 0; }

๐Ÿง  Time Complexity:

  • Best case: O(1)

  • Worst case: O(n)


๐Ÿงช Practice Problems:

  1. Find the maximum and minimum element in an array.

  2. Count how many times a given number appears in the array.

  3. Reverse an array.


๐Ÿ“˜ Homework for Day 2:

  • Write a program to copy one array to another.

  • Write a program to merge two arrays.

  • Try solving one problem from LeetCode Easy using arrays (optional but forward-thinking!).


๐Ÿ“… Day 2 Summary

  • ✅ Learned arrays

  • ✅ Implemented Linear Search

  • ✅ Practiced I/O and traversal


๐Ÿงญ Tomorrow: Sorting (Bubble Sort) + Binary Search

Would you like me to create a GitHub repo or planner to track your DSA progress daily?

Saturday, June 21, 2025

๐Ÿ“ Day 3 Blog Post: "How to Apply to Universities in Singapore – Step-by-Step Guide for 2025"

 

๐Ÿ“ Day 3 Blog Post: "How to Apply to Universities in Singapore – Step-by-Step Guide for 2025"

๐Ÿง  Category: Education > Application & Visa Process

๐Ÿ“† Posting Date: Day 3

๐Ÿ”‘ SEO Keywords:

  • how to apply to university in Singapore

  • Singapore university admission 2025

  • study in Singapore for international students

  • NUS/NTU application guide


Title Tag (SEO):

How to Apply to Universities in Singapore (NUS, NTU, SMU) – 2025 Guide

๐Ÿ“Œ URL:

/apply-singapore-universities-2025


✍️ Introduction:

Singapore is known for its world-class universities, multicultural campus life, and global career opportunities. Whether you're applying to NUS, NTU, SMU, or a polytechnic, this blog will walk you through the step-by-step admission process to study in Singapore in 2025.


๐Ÿงพ Step-by-Step University Application Guide


๐Ÿ“ Step 1: Choose Your Institution & Course

Make a shortlist based on:

  • Program reputation (e.g., NUS for CS, NTU for Engineering)

  • Career goals

  • Budget and scholarship availability

๐Ÿ”— Tip: Visit official sites like www.nus.edu.sg, www.ntu.edu.sg


๐Ÿ“ Step 2: Check Eligibility Requirements

Undergraduate:

  • GCE A-Levels / IB Diploma / Class 12 Boards (India, Malaysia, etc.)

  • English proficiency: IELTS (6.5+) / TOEFL (90+)

Postgraduate:

  • Bachelor's degree with GPA ≥ 3.0/4.0

  • GRE/GMAT (for MBA, Engineering, etc.)

  • Research proposal (if applying for PhD)

Documents you’ll typically need:

  • Passport-size photo

  • Academic transcripts

  • Personal Statement or SOP

  • Recommendation letters

  • Resume/CV

  • Portfolio (for Design/Architecture)


๐Ÿ“ Step 3: Submit Online Application

Most applications open between October–April (depending on the university).

UniversityApplication PortalTypical Deadline
NUSapplications.nus.edu.sgJan–Mar 2025
NTUadmissions.ntu.edu.sgJan–Mar 2025
SMUadmissions.smu.edu.sgMar–May 2025

๐Ÿ’ก Tip: Apply early for better chances and scholarship consideration.

๐Ÿ“ Step 4: Pay the Application Fee

  • Ranges between SGD 20–50

  • Use credit/debit card through the application portal


๐Ÿ“ Step 5: Attend Interview (if required)

  • Some courses (e.g., Medicine, Architecture, MBA) may require:

    • Online interviews

    • Admission tests

    • Portfolio review


๐Ÿ“ Step 6: Wait for Offer Letter

If accepted, you’ll receive an IPA (In-Principle Approval) letter, which is required for your Student Pass application.

⏳ Decision Time: Usually 6–10 weeks after application closes.


๐Ÿ“ Step 7: Apply for Student Pass via ICA

Use the SOLAR+ system:

  1. Your university registers you on SOLAR

  2. You receive a unique registration number

  3. Log in at ICA SOLAR Portal

  4. Submit required documents and pay the fee (~SGD 30–60)

  5. Book an appointment for issuance upon arrival


๐Ÿง‘‍๐Ÿ’ป Optional: Apply for MOE Tuition Grant

If you're not a citizen or PR:

  • Apply for the Ministry of Education Tuition Grant

  • Sign a bond (work in Singapore for 3 years post-study)


๐Ÿ“ฆ Final Checklist Before Moving to Singapore

  • Book accommodation

  • Buy travel insurance

  • Open a local bank account (DBS, OCBC, etc.)

  • Register for orientation and course modules


FAQs: University Applications in Singapore

Q: Can I apply to multiple universities at once?
✅ Yes, but each has a separate portal and application fee.

Q: Is IELTS mandatory?
✅ Only for students whose previous education was not in English.

Q: What if I miss the application deadline?
✅ Some universities offer rolling admissions or mid-year intakes — check their official calendars.


๐ŸŽ“ Conclusion:

Singapore’s education system is competitive but accessible with the right planning. By following this step-by-step guide, you’re already on track to study in one of Asia’s top university destinations.


๐Ÿ‘‰ Up Next (Day 4):

"Top Scholarships to Study in Singapore for International Students – 2025 List"

๐Ÿ“ Day 2 Blog Post: "NUS vs NTU: Which University Should You Choose?"



Title:

NUS vs NTU: Which Top Singapore University Is Right for You in 2025?


✍️ Introduction:

Singapore is home to two world-renowned universities — National University of Singapore (NUS) and Nanyang Technological University (NTU). Both are globally ranked, highly respected, and offer state-of-the-art facilities. So, how do you choose between them?

Let’s break it down and compare NUS and NTU across key factors like ranking, programs, campus life, and career opportunities.


๐Ÿ† 1. Global Rankings

CriteriaNUSNTU
QS World Ranking 2025#8 globally#26 globally
Asia Ranking#1 in Asia#5 in Asia

Conclusion: NUS leads globally and regionally, especially in research and science.

๐Ÿ“š 2. Programs & Strengths

  • NUS Strengths: Computer Science, Business, Law, Life Sciences, Medicine.

  • NTU Strengths: Engineering, Communication Studies, Education, Environmental Sciences.

Conclusion: NUS is broader with strong interdisciplinary programs. NTU is known for engineering and media.


๐Ÿซ 3. Campus Life & Location

  • NUS: Located in Kent Ridge (west), with multiple residential colleges and a city-like vibe.

  • NTU: Located in Jurong West, with a green, futuristic campus and eco-friendly architecture.

Conclusion: NTU’s campus is more self-contained and modern. NUS has more urban proximity.


๐Ÿ‘ฉ‍๐ŸŽ“ 4. Student Culture

  • NUS: Academically rigorous, more research-intensive.

  • NTU: Innovation-focused, vibrant student activities and clubs.

Conclusion: NUS leans academic; NTU leans creative and entrepreneurial.


๐Ÿ’ผ 5. Graduate Employability

  • NUS Graduates: High placement rate, especially in consulting, finance, and tech.

  • NTU Graduates: Excellent outcomes in engineering, media, and startups.

Conclusion: Both offer strong employability. NUS edges out slightly for international recognition.


๐Ÿ’ฐ 6. Tuition & Scholarships

  • Tuition fees for most undergraduate courses range from SGD 8,000 – SGD 30,000/year (with MOE Grant).

  • Scholarships available at both, including:

    • NUS Global Merit Scholarship

    • NTU Nanyang Scholarship

Conclusion: Similar tuition structures. Both offer generous merit-based support.


๐Ÿง‘‍๐ŸŽ“ 7. Admission Difficulty

  • NUS: Slightly more competitive, especially for Medicine, Law, and CS.

  • NTU: Highly competitive too, but more diverse program accessibility.

Conclusion: NUS has stricter entry requirements in top programs.


๐Ÿงพ Final Verdict: NUS or NTU?

You Should Choose...If You Want...
NUSResearch-heavy environment, broader courses, global recognition
NTUTech-forward campus, strong engineering/media focus, innovation

๐Ÿ’ก Closing Tip:

Instead of only looking at rankings, explore curriculum fit, campus culture, and career pathways. Visit virtual open houses or connect with current students to help you decide.


๐Ÿ“ข Up Next (Day 3):

"How to Apply to Universities in Singapore – Step-by-Step Guide for 2025"

๐Ÿ“ Day 1 Blog Post: "Top 10 Courses to Study in Singapore in 2025

 

✍️ Introduction:

Singapore has established itself as one of the top education hubs in Asia, offering globally recognized degrees, cutting-edge facilities, and strong industry ties. Whether you're a local student planning your next step or an international student exploring global opportunities, choosing the right course is crucial.

Here are the top 10 most in-demand and career-focused courses in Singapore for 2025.


๐ŸŽ“ 1. Computer Science & IT

  • Why it’s popular: Singapore is a digital powerhouse, leading Southeast Asia’s tech growth.

  • Career Options: Software Engineer, Data Scientist, Cybersecurity Analyst.

  • Top Institutions: NUS, NTU, SMU, SIT.


⚙️ 2. Engineering

  • Specializations: Mechanical, Civil, Electrical, Aerospace.

  • Why it’s popular: Infrastructure, sustainability, and smart nation goals.

  • Top Institutions: NTU, SUTD, SIT, NUS.


๐Ÿงฌ 3. Life Sciences & Biotechnology

  • Why it’s popular: Backed by Singapore’s biomedical research ecosystem.

  • Career Options: Biotech Researcher, Lab Analyst, Environmental Consultant.

  • Top Institutions: NUS, Duke-NUS, Yale-NUS.


๐Ÿ“ˆ 4. Business & Management

  • Specializations: Finance, Marketing, International Business, HR.

  • Why it’s popular: Singapore is a global financial center.

  • Top Institutions: NUS Business School, NTU NBS, SMU, INSEAD.


๐Ÿง‘‍๐ŸŽจ 5. Design & Creative Arts

  • Specializations: Fashion, Animation, Game Design, Visual Communication.

  • Why it’s popular: The media and design sectors are booming with digital demand.

  • Top Institutions: LASALLE, NAFA, Raffles Design Institute.


๐Ÿจ 6. Hospitality & Hotel Management

  • Why it’s popular: Singapore's vibrant tourism and event economy.

  • Career Options: Hotel Manager, Travel Coordinator, F&B Operations.

  • Top Institutions: SHATEC, MDIS, EASB.


๐Ÿฅ 7. Medicine & Nursing

  • Why it’s popular: Aging population and strong healthcare system.

  • Career Options: Doctor, Nurse, Pharmacist, Public Health Officer.

  • Top Institutions: NUS Yong Loo Lin, Duke-NUS, Parkway College.


๐Ÿ›️ 8. Architecture & Urban Planning

  • Why it’s popular: Singapore is a global model for urban sustainability.

  • Top Institutions: NUS, SUTD, BCA Academy.


✈️ 9. Travel, Aviation & Tourism

  • Why it’s popular: Singapore Changi Airport and tourism are world-class.

  • Top Institutions: Republic Polytechnic, MDIS, Kaplan.


๐Ÿ“Š 10. Data Science & Artificial Intelligence

  • Why it’s popular: AI is driving innovation across all sectors.

  • Career Options: Machine Learning Engineer, AI Developer, Data Strategist.

  • Top Institutions: NUS, NTU, SMU.


๐Ÿ’ก Conclusion:

Choosing a course is more than just following trends — it's about aligning your passion with future-ready skills. Singapore’s strong economy and globally ranked institutions make it a top destination for students with big dreams.

Next Up (Day 2): "NUS vs NTU: Which University Should You Choose?"

๐Ÿš€ 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


#include <stdio.h> int main() { printf("Hello, World!\n"); return 0; }

Compile using:


gcc hello.c -o hello ./hello

๐Ÿ“š 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:

  1. Take input of two numbers and print their sum.

  2. Print numbers from 1 to n using a for loop.

  3. Write a program to find if a number is even or odd.

Example:


#include <stdio.h> int main() { int a, b; printf("Enter two numbers: "); scanf("%d %d", &a, &b); printf("Sum = %d\n", a + b); return 0; }

๐Ÿ“… 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.


๐ŸŒŸ Tomorrow: Arrays in C + Linear Search

AI AND ROBOTICS (what is ai)

 Artificial Intelligence Artificial Intelligence is composed of two words Artificial and Intelligence, where Artificial defines "man-ma...