This repo is Developed to keep track of your learning status of C++ in accordance with @Apna College - Youtube Channel(Subscribe them if you are Indian and want to learn c++). Even though if you are not indian and want to keep track of learning experience of Programming in C++. This repo could be very useful to you guys. So Very Welcome all of you guys to this repo.
Before starting this repo i was not able to keep myself consistent and motivated towards my learning journey so i decided why not make a checklist repo which can somehow provide me a sense of achievement and also keep track of my learning the programming with c++. So thats when i decided to make this repo.
It's a long plan. It may take you months. If you are familiar with a lot of this already it will take you a lot less time.
Everything below is an outline, and you should tackle the items in order from top to bottom.
I'm using Github's special markdown flavor, including tasks lists to track progress.
Create a new branch so you can check items like this, just put an x in the brackets: [x]
Fork a branch and follow the commands below
Fork the GitHub repo https://github.com/theyounglord/The-Big-Basket-C-Plus-Plus by clicking on the Fork button on the top right corner of this repo or you can use the below method.
Clone to your local repo
git clone git@github.com:<your_github_username>/The-Big-Basket-C-Plus-Plus.git
git checkout -b progress
git remote add theyounglord https://github.com/theyounglord/The-Big-Basket-C-Plus-Plus
git fetch --all
Mark all boxes with X after you completed your changes
git add .
git commit -m "Marked x"
git rebase theyounglord/main
git push --set-upstream origin progress
git push --force
More about Github-flavored markdown
-
Writing first program on c++
Understandig the syntex of Input Output in C++ For Indians/Other than Indians
- Write a program to take two numbers as input from the user and then find average of those two numbers
Understanding the syntex of If/Else Statement For Indians/Other than Indians
- Program to find Maximum and minimum among two numbers
- Program to find Maximum of three numbers
- Program to find even or odd among two numbers
Possible Case -Both Even -Both odd -One even && One odd -One odd && one even
- Program to check if a triangle is scalene, isosceles or equilateral
- Program to check if an alphabet is a vowel or a consonant
Understanding the concept of Loops For Indians/Other than Indians
- Program to print hello world 10 times
- Program to print sum of n numbers
- Prgram to take input from user till user enters a negative number(Using While loop)
- Prgram to take input from user till user enters a negative number(Using Do While loop)
- Program to display multiplication table upto 10
- Program to add only positive numbers
i.e take input from user again and again till he/she enters the negative integer and calculate the sum of all numbers till that point
Understanding the concept of jump statements For Indians/Other than Indians
- There is a girl called Sara and her mother allows to go out with her friends only on even days of month.Also her mother gives some Pocket money each month to her and each time she goes out she spends 500 bucks.She also cannot go outside once she is left with no pocket money. Asumming that her mother gives atleast 3000 bucks every month. Write a Program to tell sara that on which dates she can go and when she have to stop
- Program to print all odd numbers till n
- Program to print all the numbers between 1 to 100 except those numbers which are divisible by 3
- Program to check that whether given number is prime or not
- Program to print all prime numbers between a given range
i.e. from a+1 to b-1
Understanding the concept of Switch Satements For Indians/Other than Indians
- Program to write hello in five different languages
i.e. ask the user to enter the langauage key and the program will print hello in that particular language
- Program to implement basic arithmetic operations between two number
- What is the output of following program?
#include<bits/stdc++.h>
using namespace std;
int32_t main(){
int i=1;
i=i++ + ++i;
cout<<i<<endl;
return 0;
}
- What is the output of following program?
#include<bits/stdc++.h>
using namespace std;
int32_t main(){
int i=1;
int j=2;
int k;
k=i + j + i++ + j++ + ++i + ++j;
cout<<i<<" "<<j<<" "<<k<<endl;
return 0;
}
- What is the output of following program?
#include<bits/stdc++.h>
using namespace std;
int32_t main(){
int i=0;
i=i++ - --i + ++i - i--;
cout<<i<<endl;
return 0;
}
- What is the output of following program?
#include<bits/stdc++.h>
using namespace std;
int32_t main(){
int i=1,j=2,k=3;
int m = i-- - j-- - k--;
cout<<i<<endl;
cout<<j<<endl;
cout<<k<<endl;
cout<<m<<endl;
return 0;
}
- What is the output of following program?
#include<bits/stdc++.h>
using namespace std;
int32_t main(){
int i=10, j=20 ,k;
k = i-- - i++ + --j - ++j + --i - j-- + ++i - j++;
cout<<i<<endl;
cout<<j<<endl;
cout<<k<<endl;
return 0;
}
- Program to take an integer as an input from the user and tell whether it is equal to, less than or more than 10
- Program to check that whether a number is divisible by both 2 and 3 or it is divisible by only one of them
- Solve all questions in this pdf
The next phase is about building logics on your own, so try as hard as possible to build or find the logics
behind the Programs on your `NoteBooks`first and then code on your systems. Also if anyone wants to edit this
repo in his/her own way. you guys are free to do. Thank you .
In this phase we are going to solve some pattern problems which will help you to develop an idea that how should we build the logics behind the problem with our learned concepts.
This Phase require an important set of time of your's, so that when we move on to the next levels, we'll have an idea in mind that how should we'll build the logics behind the problem.
Success is very uncofertable process, so make yourself comfertable with being uncomfertable.
In this level we are going to solve some pattern Problems starting with easy once to the complex ones.
Solve all the below questions using nested for Loop.
- Program to print rectangle where user provides number of rows and columns / Solution
* * * *
* * * *
* * * *
* * * *
* * * *
- Program to print hollow rectangle where user provides number of rows and columns / Solution
* * * *
* *
* *
* *
* * * *
Hint:- You have to print some spaces between the rectangle to make it hollow rectangle. i.e You have to print spaces instaed of "*", similar to the above question except in 1st row, last row, 1st column and last column.
- Print the given pattern w.r.t. variable n=5
i.e half Pyramid using numbers
take variable n as, only input to the program / Solution
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Hint:- In this Program we have to iterate all the elements of row from 1 to n. So that Row number = Number of Columns.
- Print the given pattern w.r.t. variable n=5
i.e Half Pyramid using numbers "0" & "1"
take variable n as, only input to the program /Solution
1
0 1
1 0 1
0 1 0 1
1 0 1 0 1
Hint:- This Program is very similar o the Half Pyramid using numbers Pattern. But in this you just have to figure out that at which Position you should print "1" and vice versa for "0"
- Print the given pattern w.r.t. variable n=5
i.e Floyd's Triangle
take variable n as, only input to the program /Solution
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
- Print the given pattern w.r.t. variable n=5
i.e. inverted half pyramid using "*"
take variable n as, only input to the program / Solution
* * * * *
* * * *
* * *
* *
*
Hint:- In this Program we have to iterate all the elements of row from n to 1. So that Row number = Number of Columns.
- Print the given pattern w.r.t. variable n=5
i.e. inverted half pyramid using numbers
take variable n as, only input to the program / Solution
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
- Print the given pattern w.r.t. variable n=5
i.e. half pyramid using after 180 degree rotaion using "*"
take variable n as, only input to the program / Solution
*
* *
* * *
* * * *
* * * * *
Hint:- In this Program you have to figure print some space first and then you have to print pattern using "*". Consider this Program as a rectangle pattern in which we have to print some spaces where the elements of column is less than equal to (n-i).
- Print the given pattern w.r.t. variable n=5
i.e. rhombus using "*"
take variable n as, only input to the program / Solution
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
Hint:-Consider this program as a rectangle after placing some spaces.
- Print the given pattern w.r.t. variable n=5
i.e. Hollow rhombus using "*"
take variable n as, only input to the program / Solution
* * * * *
* *
* *
* *
* * * * *
Hint:-Consider this problem as a hollow rectangle with some spaces first.
- Print the given pattern w.r.t. variable n=5
i.e. Number Pattern
take variable n as, only input to the program / Solution
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Hint:-In this Program you have to print some spaces first as usual and then when you have to print half Pyramid with an extra space after each element of the column to maintain the order and design of Pattern.
- Print the given pattern w.r.t. variable n=5
i.e. Palindromic Pattern
take variable n as, only input to the program / Need Hint? / Solution
1
2 1 2
3 2 1 2 3
4 3 2 1 2 3 4
5 4 3 2 1 2 3 4 5
- Print the given pattern w.r.t. variable n=5
i.e. Diamond Pattern using "*"
take variable n as, only input to the program / Need Hint ? / Solution
*
* * *
* * * * *
* * * * * * *
* * * * * * * * *
* * * * * * * * *
* * * * * * *
* * * * *
* * *
*
- Print the given pattern w.r.t. variable n=5
i.e. Hollow Diamond Pattern
take variable n as, only input to the program / Need Hint ? / Solution
*
* *
* *
* *
* *
* *
* *
* *
* *
*
- Print the given pattern w.r.t. variable n=5
i.e. Hollow Diamond inscribed in rectangle Pattern
take variable n as, only input to the program / Need Hint ? / Solution
* * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
* *
* * * *
* * * * * *
* * * * * * * *
* * * * * * * * *
- Print the given pattern w.r.t. variable n=5
i.e. Buuter-Fly Pattern using "*"
take variable n as, only input to the program/ NeedHint? / Solution -Try to Sove on your own without any hint
* *
** **
*** ***
**** ****
**********
**********
**** ****
*** ***
** **
* *
- Print the given pattern w.r.t. variable n=5
i.e. Hollow Buuter-Fly Pattern using "*"
take variable n as, only input to the program / Solution -Try to Sove on your own without any hint
* *
** **
* * * *
* * * *
* ** *
* ** *
* * * *
* * * *
** **
* *
- Print the given pattern w.r.t. variable n=9
i.e. Zig Zag Pattern using "*"
take variable n as, only input to the program / Solution -Try to Solve on your own without any hint
* *
* * * *
* * *
Well Congratulation now you have learned the basic concepts of Programming. And Now we are good to move to another level. Well if you ask me you are doing great and you just need to be consistent and have faith in you that in a short time you'll gain the proper understanding of each and every concept.
In nexxt phase we are going to learn and undersand some important concepts of programming.
Well if you are getting bored click on Mew and do your coding with some beats.,
- Write a Program to check that given a given number is Prime or not
- Write a Program to reverse a number / Solution
- Write a Program to check that whether the number is armstrong or not / Need hint? / Solution
- Write a Program to convert a binary number to decimal number / Solution
- Write a Program to calculate the factorial of a number / Need Hint / Solution
Understanding the concepts of Functions For Indians/ Other than indians
- Program to add 2 numbers using functions / Solution
- Program to print a given number using functions / Solution
- Program to print the factorial of two numbers using functioms / Solution
- Program to check whether the number is prime or not using functions / Solution
- Write a program to print all prime numbers between two numbers using functions / Solution
- Program to find a fibonnaci sequence till n started from 0 and 1 / Solution
- Program to find the factorial of the number using functions / Solution
- Program to calculate nCr i.e Binary coefficient using functions /Need Hint / Solution
- Program to print Pascal Triangle / Hint / Solution
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
- Write a program to find out whether a given number is even or odd using functions / Solution
- Write a program to find out whether a given character is an alphabet or not using functions / Solution
- Write a program with two functions to print the maximum and the minimum number respectively among three numbers entered by user / Solution
- Write a program with a function to swap the values of 2 given integer variables / Solution
- Write a program using functions to check if a person is eligible for voting or not by comparing his age with legal voting age i.e. 18 / Solution
- Program to find sum of first n natural numbers / Solution
- Check whether the given triplet is pyhagorian triplet or not / Solution
- Program to convert an octal number to decimal number / Solution
- Program to convert decimal to octal representation / Solution
- Program to convert hexadecimal to decimal representation / Solution
- Program to convert Decimal to Hexadecimal representation / Solution
- Program to add two binary numbers / Solution
Let's Optimize your code (Understanding Complexities of your code) For indians / Other than Indians
Well you are doing great but one thing that's making you slow is that you don't know what is the optimization of code and how to do that? Before moving ahead let's understand What is optimization of code and how you can implement in your code and what is the importance of that.
Understanding the concept of Array For Indians / Other than Indians
- Program to declare array / Solution
- Program to take take input from user for array and then print array / Solution
- Program to take input of an array of size n and then find maximum and minimum values / Solution
- Program to print Kids With the Greatest Number of Candies / Solution
EXPLANATION:-
There are n kids with candies. You are given an integer array candies,
where each candies[i] represents the number of candies the ith kid has,
and an integer extraCandies, denoting the number of extra candies that you have.
Return a boolean array result of length n, where result[i] is true if,
after giving the ith kid all the extraCandies, they will have the greatest number of candies among all the kids,
or false otherwise.
Note that multiple kids can have the greatest number of candies.
Example 1:
Input: candies = [2,3,5,1,3], extraCandies = 3
Output: [true,true,true,false,true]
Explanation: If you give all extraCandies to:
- Kid 1, they will have 2 + 3 = 5 candies, which is the greatest among the kids.
- Kid 2, they will have 3 + 3 = 6 candies, which is the greatest among the kids.
- Kid 3, they will have 5 + 3 = 8 candies, which is the greatest among the kids.
- Kid 4, they will have 1 + 3 = 4 candies, which is not the greatest among the kids.
- Kid 5, they will have 3 + 3 = 6 candies, which is the greatest among the kids.
Example 2:
Input: candies = [4,2,1,1,2], extraCandies = 1
Output: [true,false,false,false,false]
Explanation: There is only 1 extra candy.
Kid 1 will always have the greatest number of candies, even if a different kid is given the extra candy.
Example 3:
Input: candies = [12,1,12], extraCandies = 10
Output: [true,false,true]
Constraints:
n == candies.length
2 <= n <= 100
1 <= candies[i] <= 100
1 <= extraCandies <= 50
- Program to print Running Sum of 1d Array / Solution
Expalanation:-
Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]).
Return the running sum of nums.
Example 1:
Input: nums = [1,2,3,4]
Output: [1,3,6,10]
Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4].
Example 2:
Input: nums = [1,1,1,1,1]
Output: [1,2,3,4,5]
Explanation: Running sum is obtained as follows: [1, 1+1, 1+1+1, 1+1+1+1, 1+1+1+1+1].
Example 3:
Input: nums = [3,1,2,10,1]
Output: [3,4,6,16,17]
Let's understand the concept of Searching / For Indians / Other than Indians- LS / BS
Let's Understand the Selection Sort / For Indians / Other than Indians
- Program to implement selection sort (Select the smallest num and swap with the first element) / solution
- Let's Solve a riddle and write a program for this / Solution
Let's assume you have 15 rupeese . Now you go to shopkeeper's shop to buyt chocolates.
Now shopkeeper tell you that for each chocolate you have to pay 1 rupee.
And also you can buy 1 chocolate for 3 chocolate wrapers.
How many chocolates you can actually purchase
Let's Understand the Bubble Sort / For Indians / Other than Indians
- Program to implement bubble sort algorithm / Solution
Let'sUnderstand the Insertion sort / For Indians / Other than Indians
- Program to implement the insertion sort algorithm / Solution
- Given an array a[] of size n. For every i from 0 to n-1 output max(a[0], a[1],..., a[i]) / Solution
- Given an array a[] of size n. Output sum of each subarray of the given array / Solution
- Program to print Longest Arithmetic Subarray's length / Solution
* The number of visitors on the day is strictly larger than the number of visitors on each of the previous days.
* Either it is the last day, or the number of visitors on the day is strictly larger than the number of visitors on the following day.
* Note that the very first day could be a record breaking day!
Please help Isyana find out the number of record breaking days. / Solution
- Given an array arr[] of size N. The task is to find the first repeating element in an array of integers, i.e., an element that occurs more than once and whose index of first occurrence is smallest / Solution
Constraints
1 <= N <= 106
0 <= Ai <= 106
Example
Input:
7
1 5 3 4 3 5 6
Output:
2
Explanation:
5 is appearing twice and its first appearance is at index 2 which is less than 3
whose first occurring index is 3
- Given an unsorted array A of size N of non-negative integers, find a continuous subarray which adds to a given number S / Program to print Subarrays with given sum / Solution-1 / Solution-2
Constraints
1 <= N <= 105
0 <= Ai <= 1010
Example
Input:
N = 5, S = 12
A[] = {1,2,3,7,5}
Output: 2 4
Explanation: The sum of elements from 2nd position to 4th position is 12
- Program to print smallest positive missing number in array / Solution
Example: [0, -10, 1, 3, -20], Ans = 2
Hnt:-
1. Build the Check[ ] array initialized with False at all indices.
2. By iterating over the array and marking non-negative a[i] as true i.e.
if(a[i] >= 0)
check[a[i]] = True
3. Iterate in the Check[ ] from i=1, BREAK the loop when you find check[i] =
False and store that i in the ans variable.
4. Output the ans
- Program to print all sub array of an array of size n / Solution
- Program to find the subarray with maximum sum / O(n^3)approach / O(n^2)approach / Kaden's Algorithm approach O(n)
- Program to find maximum circular subarray sum / Solution
- PAIR SUM PROBLEM
Program to check if there is any two element in an arrray such that their sum is equal to the given k
Solution