Skip to main content

Posts

Showing posts from 2022

Sliding Window Technique

 sliding window Introduction Sliding window technique is use for reducing some redundant calculation which slow down program. like it can reduce time complexity from O(n^2) to O(n) with O(1) space complexity. Why use it? First of all it reduce time coplexity and also with O(1) space complexity. so let’s understand with Example… So we want to find maximum sum of k consecutive integer from array, so brute force would look like this for k=5, #include<iostream> #include<vector> using namespace std; int main(){ vector<int> arr = {5,2,6,7,7,3,2,1,3,9}; int final_max = 0; for(int i=0;i<arr.size()-5;i++){ int temp_max = 0; for(int j=i;j<i+5;j++){ temp_max += arr[j]; } if(temp_max>final_max){ final_max = temp_max; } } cout << final_max << endl; return 0; } But time complexity of above program is O(nk) Brute Force Approach As per we can see

Pascal's Triangle

 Pascal's Triangle Introduction In mathematics, Pascal’s triangle is triangular array of binomial coefficient. below you can see how it looks like… 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 How to Build it? First of all start with “1” and second rows as “1 1” then we can clearly see every element in next rows(except 1) if sum of two elements from above row. (i.e, 1+1=2, 1+2=3, 1+3=4) and with this rules we can create pascal’s triangle of n rows. Below is visual of how it will look like, Formula let’s take 0th row as first row and 0th column as first column, so we can get each value using formula where n is row number and k is column number. so for finding 1st(0 indexed) element in 2nd row we can write 2C1 which will give 2. There is one another technique, in which we need to solve (x + y)^n for nth row, if we solve (x +y)² then we will get 2nd row as coefficient of x and y in this solved formula which is x² + 2xy + y² . coefficients are (

What is Docker?

 Hello Everyone , Today we'll talk about what is docker ?, how to use it ? and why you should use it ?, then let's begin...

Makefile

 You may have seen file named Makefile or you may have type command like make, make install. so what is this file Makefile and what are this command. let's discuss about it.

Add BUY ME A COFFEE To Your Github/Website

 Hey Everyone , Today we'll discuss how to add buy me a coffee to your github or website. so let's begin

How to make Stylish GitHub Profile readme.md ?

 Hello Everyone , Today we'll how to make stylish readme.md for your Github profile(not for project) let's begin...

What is Digital Root ?

 What is a Digital root? if you have done little competitive programming or practice for Data Structure or anything else you have got a problem where you need to sum all digits of the number and do this process until the number becomes a single-digit number. so that is Digital Root, let's talk about it.

Coding Problems : Google Kick Start 2021

 Here i am gonna cover coding problem which was asked in Google kick start competition 2021 in Round A, Let' Begin.

I created website which generates Random Quotes of anime

 Hello Everyone , Today's post is all about how i created website which generates random anime Quotes. Then Let's begin...

Instagram OSINT

 OSINT stands for Open Source INTelligence . it means any information that can legally gathered from free , open source software or tool. if you want simple Example of OSINT then any search engine is OSINT. Today's Topic is Instagram OSINT then let's get started......

How to create website on Dark WEB?

 In this post we're gonna create website on Dark WEB, yeah you read it right on Dark WEB. What we need ? just Linux nothing more. Linux can be on your Rasberry Pi or on Virtual machine or on your PC, it will work. you've Linux then Let's begin....

What are the NFTs? How to earn , create and trade ?

 So you might have heard of this term "NFTs".  so what are this NFTs means. let's talk about this new thing exists in this world of internet.