Introduction to Programming with Striver

Jul 11, 2024

Lecture Notes

Introduction

  • Welcome to the channel.
  • Industrial name: Striver (Check out on LinkedIn, Twitter, Instagram, Telegram).
  • Take You Forward: an interview preparation website.

Resources Provided

  1. Strivers SD Sheet:
    • 191 well-curated problems to cover all DS algo concepts.
    • Requires basics of DS algo.
  2. Strivers A to Z DSA course/sheet:
    • 455 steps with problem links.
    • Videos for each topic.
    • Starting from basics, aimed at beginners and intermediates.

Introduction to Languages

  • Choose one language: C++, Java, Python, or JavaScript.
  • Previous video covers C++ vs Java (recommended to check out).
  • Tools: Visual Studio Code.

C++ Basics

  1. Skeleton of C++ Code:
    • Consistent structure: #include, int main(), return 0;.
    • Print example: cout.
  2. Libraries:
    • Use #include for different functionalities (e.g., iostream for input/output).
    • One consolidated library: #include <bits/stdc++.h>.
  3. Namespace:
    • Use using namespace std for convenience.
    • Otherwise, prepend std:: to functions.

Basic Programming in C++

  1. Variable Input & Output:
    • Integer example: int x; cin >> x;.
    • Printing multiple variables together.
  2. Data Types:
    • Numeric: int, long, long long, float, double.
    • Characters and Strings: char, string, getline for input.
  3. Control Structures:
    • If Statements: Basic conditional execution.
    • Nested if else: For multiple conditions.
    • Switch Statements: An alternative to if for specific cases.
  4. Loops:
    • For Loop: For repeating a block of code.
    • While Loop: Similar to for loop but checks condition before execution.
    • Do While Loop: Executes block once before checking the condition.
    • Nested Loops: Loop within a loop for more complex structures.

Introduction to Arrays and Strings

  1. Arrays:
    • One-dimensional Arrays: Storing similar data types together.
    • Two-dimensional Arrays: Arrays of arrays (e.g., matrices).
  2. Strings:
    • Storing and manipulating sequences of characters.
    • Common functions: length, accessing characters by index.

Functions

  1. Why Functions?:
    • Modularize code for better readability and reuse.
  2. Types of Functions:
    • Void Functions: Perform a task, do not return a value.
    • Return Functions: Perform a task and return a value.
    • Parameter Functions: Accept parameters for dynamic operations.
    • Pass by Value and Reference: Pass original or copy of value.
  3. Inbuilt Functions:
    • Common examples: min(), max().

Conclusion

  • Stay updated: Subscribe, follow on social media.
  • Key focus: Full-fledged Data Structures and Algorithms playlist coming soon.

If you have any doubts, check the resources in the description or follow Striver's social media for updates!