Count Inversions in an array | Q16 | Love Babbar DSA sheet | Amazon | Microsoft | Flipkart | Adobe
Vložit
- čas přidán 4. 11. 2020
- #coding #competitiveprogramming #interviewquestions #dsaseries
In this video I have explained the problem Inversion Count.
Love Babbar DSA sheet : drive.google.com/file/d/1FMdN...
Hope you like it. If have any doubt then just comment down below.
LIKE | SHARE | SUBSCRIBE
Some people are saying that he is pasting the solution of striver !! Well Striver himself said that he would be explaining solutions from GFG in his count inversion video and bro samajh ke dikha dena . Explanations in Hindi are really a boon for us 😍 Love you broo keep going 😎
Thanks brother I am stucked in this problem from three days 👍
Honestly, striver k smjhya smjh nhi aaya tha but ye wala aa gya 🫥 thnks btw.
Hi ,Just a quick query why have you taken mid +1in line no 44 inv+=merge1(a,temp,left,'mid+1',right)?
Very good explanation,thanks a lot!
You are welcome!
everything is good but ek dry run code k saath bhi karo aise thodi cheeze unclear reh jaati hai
loop start with ( i=l and i
aap ko kya phale hi guess main yeh optimal solution aah gya tha ki nhi..?
why have you taken another array can this done using only original array.
bhai tu hit hian
nice explanation bro
Why in brute force code i
@@Yash_Parashar cause j
Good effort but due to speed ,i could not undrstand
as soon as I just gonna to quite the video bacause of it's masterpiece english😁, he started in hindi. phir bhi confusion me ni aaya😅
you are doing great work but please .. teach in Hindi only... its humble request
In interview, questions will be asked in English not in Hindi
@@rockerboy4184 yesa English bolenge toh reject hona hi hai bro
bhai tere andar talent hai mai manta hu but agar kisi topic ko explain kar rha hai to usko koshish kar ki easy way me explain kar sake taki bigner level ke log bhi ache se understand kar sake
nice one keep it up and one thing if you speak in English try to be natural
why did u put j = mid
when u said j = starting point of 2nd array
j should be mid=1;
in function call he has passed mid as mid+1 ,that's why he has taken j=mid and not mid+1.
Bro, plz solve the problems in terms of O(n)
Array can never be sorted in O(N)
@@aadityasharma6855 um actually this can be solved in O(n) using BIT
@@aadityasharma6855 counting sort is also O(n+k)
Why in brute force i
Because for n-1th (last ) element there is no further element to compare. As you would have noticed j starts from i+1. Hence loop has to run only untill second last and not the last.
@@rahulagrawal3611 thank you 🙏🙏for helping
@@rahulagrawal3611 I have little bit doubt in using the nested for loop ,do you have any recommendations to perfect it.
@@Yash_Parashar Do you mean further optimizing and solving without nested for loop? If yes, then I would say I don't have much suggestion on it. Rather we should focus on optimal solution because most interviewers are only interested in getting optimal solution.
@@rahulagrawal3611 ok , but I am little bit confused in nested for loop for brute force approach,any hint or suggestion for this???
Can anyone tell me how many problems he/she is solving in a day?
she?
trying to upraise women. 😉
@@kanharajput5443 i mean he's a boy, right?
Right
@@rishabhsingh1850 bro must be crying till today
bhai tum bohot acha padhe rhe ho pr yeh angrezi ke chakkar mei na pado, hindi mei hi thik smjha paa rhe ho tum
can u explain for this example
2,5,1,3,4
as per explanation i tried
2,5. 1,3,4 ->till this we get 0 inversion
after this i am confused
need to improve
Bro please teach more in English. I am not able to completely get you when you speak in Hindi. It becomes difficult.
What mid-i doing here
++
striver ka solution full copy paste..lol
Striver also copy paste this solution from gfg..
its sort...not short....its super annoying when you say it short.
very bad explanation