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
- Strivers SD Sheet:
- 191 well-curated problems to cover all DS algo concepts.
- Requires basics of DS algo.
- 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
- Skeleton of C++ Code:
- Consistent structure:
#include
, int main()
, return 0;
.
- Print example:
cout
.
- Libraries:
- Use
#include
for different functionalities (e.g., iostream for input/output).
- One consolidated library:
#include <bits/stdc++.h>
.
- Namespace:
- Use
using namespace std
for convenience.
- Otherwise, prepend
std::
to functions.
Basic Programming in C++
- Variable Input & Output:
- Integer example:
int x; cin >> x;
.
- Printing multiple variables together.
- Data Types:
- Numeric:
int
, long
, long long
, float
, double
.
- Characters and Strings:
char
, string
, getline
for input.
- Control Structures:
- If Statements: Basic conditional execution.
- Nested if else: For multiple conditions.
- Switch Statements: An alternative to if for specific cases.
- 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
- Arrays:
- One-dimensional Arrays: Storing similar data types together.
- Two-dimensional Arrays: Arrays of arrays (e.g., matrices).
- Strings:
- Storing and manipulating sequences of characters.
- Common functions: length, accessing characters by index.
Functions
- Why Functions?:
- Modularize code for better readability and reuse.
- 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.
- 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!