Skip to content

Latest commit

 

History

History
914 lines (704 loc) · 21.2 KB

README.md

File metadata and controls

914 lines (704 loc) · 21.2 KB

CONSOLEBUSTERS

Download Epic Notes

📩Download Awesome Notes

COURSE MENTORS LOVE BABBAR AND LAKSHAY KUMAR BHAIYA

This course belongs to The code help and follows both our favorite mentors Love Babbar & Lakshay Kumar.

PDF NOTES AND CPP PROGRAMS

In this repository, you will get each and every class's notes in the form of a PDF and program with an explanation. Also, get the notes on the discord channel Console Buster as well as subscribe to the youtube channel Console Buster to watch our doubts and much more.

COURSE STRUCTURE

WEEKLY DOUBTS CLASSES
✅WEEK 06
	DOUBT 01: Lower and upper bound for sorted array
	DOUBT 02: Remove All Occurrences of a Substring (Leetcode-1910)
	DOUBT 03: Majority Element (Leetcode-169)
WEEK 01 TOPIC: Introduction to programming
CLASS NOTES: 01
	1. How to approach a problem
	2. What is pseudocode and flowchart

CLASS HOMEWORK: 01
	1. Examples of pseudocode and flowchart

WEEK 01 TOPIC: Write your first C++ program
CLASS NOTES: 02
	1. Why do we need programming language
	2. How compiler and interpreter work
    	3. Where to code
    	4. Lets write down the first code
    	5. Print Love Babbar
    	6. Variables and data types
    	7. How data is stored
    	8. Signed and unsigned data
    	9. Operators in C++

CLASS HOMEWORK: 02
	1. 32 bits VS 64 bit architecture
    	2. Typecasting: implicit and explicit
    	3. Number system: binary to decimal

WEEK 01 TOPIC: Conditionals and loops
CLASS NOTES: 03
	1. Conditional statements
	2. Loop statements
    	Pattern 1: Square pattern
    	Pattern 2: Rectangle pattern
    	Pattern 3: Hollow Rectangle pattern
    	Pattern 4: Half Pyramid pattern
    	Pattern 5: Inverted Half Pyramid pattern
    	Pattern 6: Numeric Half Pyramid pattern
    	Pattern 7: Inverted Numeric Half Pyramid pattern

CLASS HOMEWORK: 03
	0. All flowcharts are converted into CPP programs
	1. Multiply two numbers by taking input from user
    	2. Find the perimeter of a triangle
    	3. Find the simple interest
    	4. Find the compound interest
    	5. Print counting from n to 1
    	6. Find the factorial of a number
    	7. Check if number is prime or not
    	8. Check valid triangle or not
    	9. Print max of three numbers

WEEK 02 TOPIC: Pattern continues
CLASS NOTES: 04
	Pattern 08: Full Pyramid
	Pattern 09: Inverted Full Pyramid
    	Pattern 10: Dimond Pattern
    	Pattern 11: Hollow Full Pyramid
    	Pattern 12: Inverted Hollow Full Pyramid
    	Pattern 13: Hollow Diamond pattern
    	Pattern 14: Flipped Solid Diamond pattern
    	Pattern 15: Fancy pattern 1
    	Pattern 17: Inverted Hollow Half Pyramid
    	Pattern 19: Fancy pattern 4

CLASS HOMEWORK: 04
	Pattern 16: Fancy pattern 2
	Pattern 18: Fancy pattern 3 -> Numerical Hollow Half Pyramid
    	Pattern 20: Numeric Hollow Inverted Half Pyramid
    	Pattern 21: Numeric Palindrome Equilateral Pyramid
    	Pattern 22: Fancy pattern 5
    	Pattern 23: Solid Half Diamond
    	Pattern 24: Floyd Triangle
    	Pattern 25: Butterfly Pattern

WEEK 02 TOPIC: Bitwise operators and loops
CLASS NOTES: 05
	1. Bitwise operators
	2. Left and right shift operators
    	3. Pre/post increment and decrement operators
    	4. Break and continue keyword
    	5. Variable scoping
    	6. Operator precedence table

CLASS HOMEWORK: 05
	1. All homework programs
	2. Why global variables are bad practice
WEEK 02 TOPIC: Functions
CLASS NOTES: 06
	1. What is function
	2. Function call stack
    	3. Write a function to print sum of 3 numbers
    	4. Write a function to return sum of 3 numbers
    	5. Find maximum of three numbers
    	6. Counting from 1 to N
	7. Check prime or not prime number
	8. Check number is even or odd
	9. Sum of all numbers upto 1 to N
	10. Sum of all even numbers upto 1 to N

CLASS HOMEWORK: 06
	1. Function to find area of circle
	2. Function to find factorial of a number
    	3. Print all prime numbers from 1 to N
    	4. Print all digits of an integer
    	5. Creating a number using digits
    	6. Print binary representation of a decimal number
	7. Convert KM into Miles
	8. Convert farenheit to celcius
	9. Count all set bits of a number
	10. Check even/odd using bitwise operator
WEEK 03 TOPIC: Arrays - Level 1
CLASS NOTES: 07
	1. What is array
	2. Why do we need of array
    	3. Create an array
    	4. Symbol table
    	5. Address operator and sizeof operator
    	6. Array initialization
	7. Bad practice with array size
	8. Array indexing
	9. Access elements of array
	10. Taking input in an array
	11. Meaning of arr[i] (FORMULA)
	12. Updating array with example
	13. Linear search in an array
	14. Array and function
	15. Programs
	    a.) Count 0's and 1's in an array
	    b.) Minimum and maximum number in an array
	    c.) Reverse an array (Two pointer approach)
	    d.) Extreme print an array

CLASS HOMEWORK: 07
	1. No homework
WEEK 03 TOPIC: Arrays - Level 2
CLASS NOTES: 08
	1. Function pass by value
	2. Function pass by reference
    	3. Array and function (pass by reference)
    	4. Program 01: Find unique element
    	5. Program 02: Print all pairs
    	6. Program 03: Print all triplets
	7. Program 04: Sort 0's and 1's
	8. Introduction to time and space complexity

CLASS HOMEWORK: 08
	1. Program 05: Shift array's element by one (Right to left)
	2. Program 06: Shift array's element by two (Right to left)
	3. HW 01: Shift array's element by one (Left to right)
WEEK 03 TOPIC: Arrays - Level 3
CLASS NOTES: 09
	1. 2D-Array
	2. Create 2D-Array
    	3. Initialize 2D-Array
    	4. Access 2D-Array's elements
    	5. How 2D-Array stored in memory
    	6. Print 2D-Array row wise
	7. Print 2D-Array column wise
	8. Taking input from user in 2D-Array
	9. Linear Search in 2D-Array
	10. Maximum and Minimum in 2D-Array
	11. Print row wise and column wise sum of 2D-Array
	12. Sum of principal diagonal elements of a matrix
	13. Transpose of a matrix
	14. Vector Notes
	15. Jagged Array

CLASS HOMEWORK: 09
	1. Column wise sum of a 2D-Array
	2. Sum of secondary diagonal elements
WEEK 03 TOPIC: Arrays - Extra Class
CLASS NOTES: 10
	1. Moving All Negative Number to the Left Side of an Array
	2. Sort Colors (Leetcode-75)
    	3. Rotate Array (Leetcode-189)
    	4. Missing Number (Leetcode-268)
    	5. Row with maximum ones (VVIimp Leetcode-2643)
    	6. Rotate Image by 90 degree (VVImp Leetcode-48)

CLASS HOMEWORK: 10
	1. Re-arrange array elements (Leetcode-2149)
	2. Find Pivot Index (Leetcode-724)
	3. Find Duplicate Number (Leetcode-287)
	4. Missing Element From An Array With Duplicates (GFG)
	5. Find First Repeating Element (GFG)
	6. Common Element in 3 Sorted Array (GFG)
	7. Wave Print A Matrix (GFG)
	8. Spiral Print A Matrix (Leetcode-54)
	9. Factorial of A Large Number (GFG)
	10. Key Pair/Two Sum (GFG and Leetcode-1)
	11. Remove Duplicates From Sorted Array (Leetcode-26)
	12. Maximum Average Subarray 1 (Leetcode-643)
	13. Find Pivot Index with prefix sum approach (Leetcode-724)
	14. Missing Number with XOR operator (Leetcode-268)
	15. Add two numbers represented by two array (GFG Solved before Q.No. 9)
WEEK 04 TOPIC: Searching and Sorting - Level 1
CLASS NOTES: 11
	1. Linear search
	2. Binary search (MONOTONIC ARRAY)
    	3. Time complexity of binary search
    	4. Rules of binary search
    	5. Find first occurrence of a number in sorted array
    	6. Find last occurrence of a number in sorted array
	7. Find total occurrence of a number in sorted array
	8. Find missing element in sorted array (GFG)
	9. Peak element/index in a mountain array (Leetcode-852)

CLASS HOMEWORK: 11
	1. Find pivot element (LeftSum equals to RightSum)(Leetcode-724)
WEEK 04 TOPIC: Searching and Sorting - Level 2
CLASS NOTES: 12
	1. Find pivot element index from sorted and rotated array
	2. Search in a rotated and sorted array (Leetcode-33)
    	3. Sqrt of X (Leetcode-69)
	4. Binary search in 2D array (Leetcode-74)

CLASS HOMEWORK: 12
	1. Find sqrt of X upto N decimal place
WEEK 04 TOPIC: Searching and Sorting - Level 3
CLASS NOTES: 13
	1. Divide two number using Binary search without using any / and % operator
	2. Binary search on nearly sorted array
    	3. Find the Number Occurring Odd Number of Times (Leetcode-540)

CLASS HOMEWORK: 13
	1. K-Diff Pairs in An Array (Leetcode-532)
	2. Find K-Closest Element (Leetcode-658)
	3. Exponential Search (Concept)
	4. Unbounded Binary Search (Concept)
	5. Book Allocation Problem (GFG & Code studio)
	6. Painters Partition Problem (GFG & Code studio)
	7. Aggressive Cows (GFG & Code studio)
	8. EKO SPOJ
	9. PRATA SPOJ
	10. Find SQRT of Integer N using Binary Search with K point decimal precision.
	11. Divide using Binary Search with K point decimal precision.
	12. Majority Element (Leetcode-169)

✅SORTINGS
	1. BUBBLE SORT
	2. SELECTION SORT
    	3. INSERTION SORT

✅CUTOM COMPARATOR
	1. SORT A VECTOR
	2. SORT VECTOR OF VECTOR
WEEK 05 TOPIC: Char Arrays and Strings - Level 1
CLASS NOTES: 14

	✅CHAR ARRAYS
	1. What is char array
	2. ASCII CHARACTER CODE 256
    	3. Char array creation
	4. Taking input in char array
	5. Print and access char array
	6. Null char ASCII CODE
	7. Delimiter concept
	8. cin.getline(p1,p2) method
	9. Program 01: Length of string
	10. Program 02: Reverse string
	11. Program 03: Uppercase to lowercase and vice versa
	12. Program 04: Replace @ with the white space
	13. Program 05: Check palindrome

	✅STRINGS
	14. What is string?
	15. Creation of string
	16. Taking input in string
	17. Print string and access string by index
	18. getline(cin,name) method
	19. Char array Vs string
	20. Important predefined function of string
	->	Method 01:
	->	Method 02:
	->	Method 03:
	->	Method 04:
	->	Method 05:
	->	Method 06:
	->	Method 07:
	->	Method 08:
	->	Method 09:
	->	Method 10:


CLASS HOMEWORK: 14
	1. ASCII CHARACTER CODE 256
	2. Explore build in method from CPLUSHCPLUSH.COM
WEEK 05 TOPIC: Char Arrays and Strings - Level 2
CLASS NOTES: 15
	1. Remove All Adjacent Duplicates In String (Leetcode-1047)
	2. Remove All Occurrences of a Substring (Leetcode-1910)
    	3. Valid Palindrome II (Leetcode-680)
	4. Palindromic Substrings (Leetcode-647)


CLASS HOMEWORK: 15
	1. Remove All Adjacent Duplicates in String II (Leetcode-1209)
	2. Minimum Time Difference (Leetcode-539)
WEEK 05 TOPIC: Char Arrays and Strings - Level 3
CLASS NOTES: 16
	1. Decode the Message (Leetcode-2325)
	2. Minimum Amount of Time to Collect Garbage (Leetcode-2391)
    	3. Custom Sort String (Leetcode-791)
	4. Find and Replace Pattern (Leetcode-890)


CLASS HOMEWORK: 16
	1. Valid Anagram (Leetcode-245)
	2. Reverse Only Letters (Leetcode-917)
	3. Longest Common Prefix (Leetcode-14)
	4. Reverse Vowels of a String (Leetcode-345)
	5. Isomorphic Strings (Leetcode-205)
	6. Group Anagrams (Leetcode-49)
	7. Reorganise String
	8. Longest Palindromic Substring
	9. Find the Index of the First Occurrence in a String
	10. String to Integer (atoi)
	11. String Compression
	12. Integer to Roman
	13. Zig-zag Conversion
	14. Largest Number
	15. Remove All Adjacent Duplicates in String II (Leetcode-1209)
	16. Implement std::string::erase()
	17. Minimum Time Difference (Leetcode-539)
	18. Number of Laser Beams in a Bank (Leetcode-2125)
WEEK 06 TOPIC: Basic Maths & Pointers - Level 1
CLASS NOTES: 17
	1. What is pointer
	2. Address operator
    	3. Creation of pointers
	4. Access pointer and dereference operator
	5. Declaration of pointer (5 Practice Questions)
	6. Pointer with array (4 Practice Questions)
	7. Char array and pointer (4 Practice Questions)


CLASS HOMEWORK: 17
	1. Why pointer size was coming 8 while printing
	2. why we can not do [arr = arr + 1;] in C++
	3. Wild pointer in C++
	4. Void pointer in C++
	5. Dangling pointer in C++
	6. Pointers imporatant doubt

BASIC MATHEMATICS FOR DSA
	PROGRAM 01: Count primes (Leetcode-204)
		APPROACH 01: Naive
		APPROACH 02: SQRT
		APPROACH 03: Sieve of Eratosthenes
		APPROACH 04: Segmented sieve
	PROGRAM 02: Find GCD/HCF using Euclids Algorithm (GFG)
	PROGRAM 03: Find LCM (GFG)
	CONCEPT 01: Modulo Arithmetic
	PROGRAM 04: Fast exponentiation (GFG)
		APPROACH 01: Naive solution
		APPROACH 02: Better solution
	PROGRAM 05: Modular Exponentiation for large numbers (GFG)
	PROGRAM 06: Optimising Sieve of Eratosthenes
	PROGRAM 07: Segmented Sieve (GFG)
	PROGRAM 08: HW🔗Product of primes (GFG)
WEEK 06 TOPIC: Basic Maths & Pointers - Level 2
CLASS NOTES: 18
	1. Array of pointer
	2. Pointer to an array
    	3. Pointer with functions
	4. Pointer to pointer (3 Practice Questions)
	5. Pass by value
	6. Pass by reference
	7. MCQs on pointers practice
WEEK 07 TOPIC: Recursion - Level 1
CLASS NOTES: 19
	1. Bookish definition of recursion
	2. Love Bhaiyas definition of recursion
    	3. Recursion mandatory terms
	4. Factorial of n number
	5. How recursion work and function call stack
	6. Why base case important (Due to Stack Overflow)
	7. Reverse counting from n to 1
	8. Tail and head recursion
	9. Pow(2,N)
	10. Recursive tree
	11. Fibonacci series
	12. Return sum from n to 1

CLASS HOMEWORK: 19
	1. Time and space complexity of recursion
WEEK 07 TOPIC: Recursion - Level 2
CLASS NOTES: 20
	1. Climbing stairs (Leetcode-70)
	2. Print array
	3. Search in array
	4. Minimum in array
	5. Arrays even elements stored in vector
	6. Double each element
	7. Find in Array
	8. Print index of all occurrence of target
	9. Return vector with all occurrences of target
	10. Print the digits of the number

CLASS HOMEWORK: 20
	1. Print the Fibonacci series using an iterative method
	2. Maximum in an array
	3. Print number of digits
	4. Find target in string and print it's target indices
WEEK 07 TOPIC: Recursion - Level 3
CLASS NOTES: 21
	1. Check array sorted or not
	2. Binary search recursive solution
	3. Pattern 01: Include and exclude pattern
		✅Problem: Subsequence of string
	4. Pattern 02: Exploring all possible ways pattern
		✅Problem: Maximize the cost segment (GFG)
	5. Coin change (Leetcode-322)
	6. House Robber (Leetcode-198)

CLASS HOMEWORK: 21
	1. Last occurrence of a char
	2. Reverse a String
	3. Add Two Strings (Integer stored as String)
	4. Palindrome Check
	5. Print all Subarray
	6. Remove all Occurrence of a Substring
	7. Buy and sell stocks
	8. House Robbery problem
	9. Integer to English words
	10. Wild Card Matching
	11. Perfect Square
	12. Minimum Cost for Tickets
	13. Number of Dice Roll with Target Sum
WEEK 08 TOPIC: Backtracking & Divide and conquer - Class 01
CLASS NOTES: 22
	1. Divide and conquer algorithm
	2. Merge sort
	3. Merge two sorted array
	4. Stack and heap memory
	5. Time complexity of merge sort
	6. Quick sort algorithm

CLASS HOMEWORK: 22
	1. Space complexity of merge sort
	2. Inversion count in Array using Merge Sort
WEEK 08 TOPIC: Backtracking & Divide and conquer - Class 02
CLASS NOTES: 23
	1. What is backtracking?
	2. Permutation of string
	3. Rat in a maze

CLASS HOMEWORK: 23
	1. Count inversion
	2. In-place merge sort
	3. Maximum Subarray
	4. Combination sum problem
	5. Combination sum problem - II
	6. Permutation - II
	7. Beautiful Arrangement
	8. Distribute Repeating Integers
WEEK 08 TOPIC: Recursion marathon - Extra class
CLASS NOTES: 24
	1. Maximum sum of nod - adjacent element - House Robber (Leetcode-198)
	2. House Robber II (Leetcode-213)
	3. Count Derangements (GFG)
	4. Painting Fence Algorithm (GFG)
	5. Edit distance (Leetcode-72)
	6. Maximal Square (Leetcode-221)

CLASS HOMEWORK: 24
	1. 0/1 Knapsack Problem (GFG)
	2. Minimum Score Triangulation of Polygon (Leetcode-1039)
	3. Number of Dice Rolls With Target Sum (Leetcode-1155)
WEEK 09 TOPIC: Object Oriented Programming - Class 01
CLASS NOTES: 25
	1. Local and global variable
	2. Memory layout of a program
	3. Functional programming
	4. Object oriented programming
	5. Class
	6. Object
	7. Access modifiers
	8. Constructor
	9. Polymorphism
	10. This pointer
	11. Stack and Heap memory allocation
	(Static and Dynamic Allocation of memory)
	12. Padding concept

CLASS HOMEWORK: 25
	1. Const keyword
	2. Default argument
	3. Initialization list
	4. MACROS
	5. Static keyword in class
		- How does class work
		- Static data members
		- Static member function
WEEK 09 TOPIC: Object Oriented Programming - Class 02
CLASS NOTES: 26
	1. Copy constructor
	2. Life cycle of an object
	3. Destructor
	4. Getter and setter method
	5. Abstraction (One Pillar of OOPS)
	5.1. Encapsulation
	5.1.1 Perfect encapsulation
	5.2 Inheritance
	5.2.1 Mode of inheritance table
	5.2.2 Type of inheritance
	5.2.2.1 Single inheritance
	5.2.2.2 Multilevel inheritance
	5.2.2.3 Hierarchical inheritance
	5.2.2.4 Multiple inheritance
	5.2.2.5 Diamond Problem (Hybrid inheritance)
	5.2.2.5.1 Sol 01: Scope resolution
	5.2.2.5.2 Sol 02: Using virtual
	5.3 Polymorphism
	5.3.1 Static/compile time polymorphism
	5.3.1.1 Function overloading
	5.3.1.2 Constructor overloading
	5.3.1.3 Operator overloading
	5.3.1 Run time polymorphism

CLASS HOMEWORK: 26
	1. Shallow vs deep copy
	2. Can constructor be made private
	3. Friend keyword in C++
WEEK 09 TOPIC: Object Oriented Programming - Class 03
CLASS NOTES: 27
	1. Run time polymorphism

CLASS HOMEWORK: 27
	1. Virtual CTOR vs virtual DTOR
	2. Abstraction in C++
	3. Inline function
WEEK 10 TOPIC: Linked List - Class 01
CLASS NOTES: 28
	1. What is a node?
	2. What is a linked list?
	3. Why use of linked list?
	4. Types of linked list
	5. Create a linked list and a node
	6. Print linked list
	7. Print the length of the linked list "Number of nodes"
	8. Insertion operations of SLL
		- Print linked list
		- Find length of linked list
		- Insert node at the head
		- Insert node at the tail
		- Insert at any position
	9. Create a tail

CLASS HOMEWORK: 28
	1. Insert at any position with the help of only one pointer "PREVIOUS"
WEEK 10 TOPIC: Linked List - Class 02
CLASS NOTES: 29
	1. Deletion operations of SLL
		- Delete a node from the head
		- Delete a node from the tail
		- Delete a node from any position
	2. Double linked list
		- Print linked list
		- Find length of linked list
		- Insert node at the head
		- Insert node at the tail
		- Insert at any position
	3. Deletion operations of DLL
		- Delete a node from the head
		- Delete a node from the tail
		- Delete a node from any position

CLASS HOMEWORK: 29
	1. Circular linked list
WEEK 10 TOPIC: Linked List - Class 03
CLASS NOTES: 30
	1. Reverse Linked List (Leetcode-206)
		- Approach 1: Iterative approach
		- Approach 2: Recursive approach
	2. Middle of the Linked List (Leetcode-876)
		- Approach 1: getLength and getMid
		- Approach 2: Slow and fast pointer "Hare & Tortoise" algorithm
		- Reasoning : Why this algorithm work
	3. Palindrome Linked List (Leetcode-234)
		- Approach 1: Optimal
		- Approach 2: Brute force
	4. Linked List Cycle (Leetcode-141)
		- Approach 1: Using STL map
WEEK 10 TOPIC: Linked List - Class 04
CLASS NOTES: 31
	1. Linked List Cycle (Leetcode-141) 
		- Approach 1: Fast and slow algorithm
		- Reasoning : Why this algorithm work
	2. Starting point of loop (Leetcode-142)
		- Approach 1: Fast and slow algorithm
		- Reasoning : Why this algorithm work
	3. Remove loop (GFG)
		- Approach 1: Fast and slow algorithm
	4. Add 1 to a linked list (GFG)
	5. Reverse Nodes in k-Group (Leetcode-25)
		- Approach 1: Recursive approach
	6. Remove Duplicates from Sorted List (Leetcode-83)

CLASS HOMEWORK: 31
	1. Add two linked list (Leetcode-442)
	2. Sort 0, 1, 2 in linked list (GFG)
	3. Sort linked list (Leetcode-148)
	5. Quick Sort Algorithm is best for array or linked list?
	7. Merge Sort Algorithm is best for array or linked list?