Just a simple experience , Kabhi bhi contests mein in built pow function mat use karna becoz I don't know why voh kabhi kabhi kuch int/float kuch dikkat ki vajaah se round off karke small answer deta h , mera iski vjaah se contest mein 1 hour kharaab hogya tha , That's it ! I hope it will help
#Luv Time Complexity : depends on the precision and nth root.
For 2 decimal places precision, the search space between 2 consecutive numbers will become : 100 So, say : 0---4 with 2 decimal places precision. x = 4, whose nth root has to be found & d = precision value Search Space : 0---1, 1---2, 2---3, 3---4 ===> 100*4=400 So search space = x * ( 10^d ),
Since binary search will be applied here, so time complexity : log ( x * ( 10^d ) )---->base is 2 Now, further, if we want nth root, then we will have to check each number by multiplying it n times : a^n = x, So total time complexity : n * log 2 ( x * ( 10^d ) )
it will run infinitely as high and lo will never become equal, as there will always exist a unique (hi+lo) /2 for two given hi and lo. We are not dealing with integers here we are dealing with decimals.
HELP !!! if low = mid and high = mid let say we need to find sqrt of 16 , so acc to above conditions [do dry run for number 16] (low wil become 3 at last ) (and high would become 4) then 3 + 4 = would always give me 3 point something. how is the code giving us ans 4; if the (3 + 4 is always giving me 3 point x).
thankyou so much bhai sari videos ek dum mast haii bahut kuch sikhne ko mill raha haii kabhi kabhi mann nahi karta video dekhne ka pr jaise hi on karta hu puri dekh leta hu aurr vo bhii interest ke sath. Bhai ek cheez ye kuch planned haii kyaa ki kabb takk over ho jayega course? and kuch questions ki list type se de sakte ho kyaa for practice bahut sare haii choose nahi kr pa rahe ki kaun se karne chaiye
jin topics me mere pass particular list hoti hai un topics me list de deta hu mai generally, jinke liye nhi hoti vo kaise dunga. As such koi idea nhi hai muje kab tak khatam hoga, all i know is i try to put two videos a week, jab topics over ho jayenge kahtam ho jayega.
bhaiya kabhi views ke chakkar mai mat rehna kyunki minimum 4,5 log toh sincerely follow kar rehe honge maximum pata ni ...CP samjne ke liye aap pe hi dependent hun mai :)
why low+eps would b there, we just need decrease search space into half at every step, and get closer to actual square root, hence lo= mid works properly.low+eps could lead to miss of actually number which was there.
no, p is the pth root, for every while loop iteration we have o(p) loop, log ke anadar sirf search space ka size ayega basically while loop kitni baar chlega and while loop kitni baar chlega doesnt depend on p
can u tell me why we didnt put lo=mid and high=mid+1 in the video?? Is it cause we r dealing with decimals here and its multiplication...or its alright if u use high= mid+1 or high = mid
Bhaiya I have a query related to Software Development, Bhaiya I am doing this C++ course and side by side I am doing DS & ALGORITHMS in C++ only, Bhaiya I am in 2nd year and I want to know ki what I have to do in Software Development and should I continue on what I am doing or start to learn about development know? Also my teachers are telling me to shift to Java,but I like C++ batana Bhaiya kya karu?
Sir for practice questions , multiple coding platform use karna cahiye ya only codeforces, codechef, leetcode se hi acha se karna hai ? If u have any suggestions then please tell me .
#include #define int long long #define ld long double #define fi first #define se second #define vi vector #define vvi vector #define pb push_back #define all(a) (a).begin(),(a).end() #define f(i,x,y) for(ll i=x; i>t;
Sequence, subsequence, subarray etc. of string aur array pr bhi questions bnaye bhaiya ji.🙏 Ye questions nhi bnte h mere se, aur bhut baar campus exam se out bhi ho chuka hu en sbhi questions ke karan 😞
there is not single technique to solve those kind of problems, generally those questions use concepts all over the place, there i no particular method to solve those problems. Almost of the time logic is different. Just read their solutions if you are not able to solve and you will understand what i am trying to say.
how is high = mid + epsilon making any sense ? , you are increasing the value of high ?, in case you meant low = mid + epsilon, we are not doing that here because we are dealing with doubles, if sqrt lies between mid and mid + eps, you will loose it.
@@iamluv yeah, I meant low only. I mentioned it this way since we wanted accuracy 10 times the epsilon. So why it will make any difference. Moreover, I came up with this idea from the trivial Binary search. Anyways I understood your explanation, thankyou for your time.
Thank U very much !
You are the best teacher on TH-cam I have ever found and I learn my best lesson about CP from you.
Thank you sir. Thank you very very much.
I can see how you are working on your video making style compared to the previous videos. Keep improving you're doing great job . Much love❤️
Interesting concept!!! And yah when I first saw the title I was curious about the video. Keep on going. ❤️
I just randomly clicked this video, and now I'm in love with it. Keep going and upload great videos like these❤️
you can check the course playlist, its filled with videos like these
sure it is now the most underrated channel ....but i can visualize the upcoming million subscribers of this channel
Same
Maja aa Gaya bhaiya,bohot detailed aur easy explanation tha
Dedication = Luv editing the correction in video and not in comment 🤩🤩👌
Wow! This video really was The Answer to Life, The Universe and Everything!
;)
Just a simple experience ,
Kabhi bhi contests mein in built pow function mat use karna becoz I don't know why voh kabhi kabhi kuch int/float kuch dikkat ki vajaah se round off karke small answer deta h , mera iski vjaah se contest mein 1 hour kharaab hogya tha , That's it ! I hope it will help
luv is love, bhai tum videos banate raho, mein placement ki tayari krta rahunga, aur place hote hi tumhe bataunga
love u thanks for a perfect series!
only 1k views for a perfect video!!!!!!!!!!!!!?
this content deserves over 1B+ views
Nice explanation of binary search.
Thank you bhai! 😇
Greatly explained
amazing luv bhaiyya keep it up !!
absolute gem🙌🙌
thanks, bro great approach
Totally appreciate your efforts bhaiya!! Great work!
#Luv
Time Complexity : depends on the precision and nth root.
For 2 decimal places precision, the search space between 2 consecutive numbers will become : 100
So, say : 0---4 with 2 decimal places precision. x = 4, whose nth root has to be found & d = precision value
Search Space : 0---1, 1---2, 2---3, 3---4 ===> 100*4=400
So search space = x * ( 10^d ),
Since binary search will be applied here, so time complexity : log ( x * ( 10^d ) )---->base is 2
Now, further, if we want nth root, then we will have to check each number by multiplying it n times : a^n = x,
So total time complexity : n * log 2 ( x * ( 10^d ) )
Hi bro I recently started learning from your playlist, I want to ask how should I practice problems after watching your video about a specific topic??
go to any coding websites and search for questions of that topic and try to solve in lot of video questions links are also given in video description.
Wow! Amazing!
Really good explanation. Thank you so much sir.
If TH-cam had a feature of multiple likes I would have given a million likes to this one
Couldn't we directly while(hi>lo) instead of while(Hi-Lo>eps)
BTW thank you very much for the gr8 video ❤️❤️❤️
it will run infinitely as high and lo will never become equal, as there will always exist a unique (hi+lo) /2 for two given hi and lo. We are not dealing with integers here we are dealing with decimals.
@@iamluvOhhh gr8 , Thank you very much ❤️
Bahiya you are doing great jobs for free which means great and the content is also great thanks for this comptetive web series
HELP !!!
if low = mid and high = mid
let say we need to find sqrt of 16 , so acc to above conditions [do dry run for number 16] (low wil become 3 at last ) (and high would become 4) then 3 + 4 = would always give me 3 point something.
how is the code giving us ans 4; if the (3 + 4 is always giving me 3 point x).
God bless you
OP vai😁😁😁😁
thankyou so much bhai sari videos ek dum mast haii bahut kuch sikhne ko mill raha haii kabhi kabhi mann nahi karta video dekhne ka pr jaise hi on karta hu puri dekh leta hu aurr vo bhii interest ke sath. Bhai ek cheez ye kuch planned haii kyaa ki kabb takk over ho jayega course? and kuch questions ki list type se de sakte ho kyaa for practice bahut sare haii choose nahi kr pa rahe ki kaun se karne chaiye
jin topics me mere pass particular list hoti hai un topics me list de deta hu mai generally, jinke liye nhi hoti vo kaise dunga. As such koi idea nhi hai muje kab tak khatam hoga, all i know is i try to put two videos a week, jab topics over ho jayenge kahtam ho jayega.
can"t we do --> lo= mid+eps in the if statement so that it resembles the algo in previous videos.
I think yes. we can do. but the ans still remains the same.
luv you luv bhai... 😁❤️
Bhai string k competitive programming wale questions kab aaenge . Like longest palindromic subsequence , interleaving etc. Please make it ASAP plss🙏🙏
Where u got that much knowledge 🤞🤞
thanks a lot bhaiya
Thanks you ❤️
Luv sir, plz make video on sliding window technique.
bhaiya kabhi views ke chakkar mai mat rehna kyunki minimum 4,5 log toh sincerely follow kar rehe honge maximum pata ni ...CP samjne ke liye aap pe hi dependent hun mai :)
last me lo hi kase kuch bhi return kr denge..mid return krna ciye na
Bro plzz continue keeping videos plzzz
thanks bhaiya
Please please bhaiya.....rukna mat ye course
nhi rukenge bhai
@@iamluv we all have great faith in you bhaiya
Superb
Subscribed 👍👍👍
Hey, could you tell me why is hi=mid and not hi=mid-eps?
Because doing that you could miss the actual square root as square root can lie between hi - eps and hi
@@iamluv So can we declare eps li 1e-8 so that we wont miss?
bhai cout 6 precision tak print karta hai.
double a=(2.00001+1.99998)/2;
cout
Why is "lo" made mid not mid + 1?
How can we recognise that problem get solved by which method. If any trick is there please share.
there is no trick, you learn with experience and solving more and more problems.
Is wale binary search pe low=mid+1 kyu nehi liya, thora ache examples seh bata sakte ho? bhaiya
bro i have confusion in mid*mid
why low+eps would b there, we just need decrease search space into half at every step, and get closer to actual square root, hence lo= mid works properly.low+eps could lead to miss of actually number which was there.
During finding mid=l+h/2 all are integeres ,so calculation never go in double?
you need to work more on basic or maybe you need a pair of glass
all the variables are double. if you can't figure out
@@privacysimplified2580 Can't you be a bit humble
Isme bhaiya aap kaise pahchane ki high=mid hoga ,not mid-1?
Big fan
Why is p outside log(N*10^N) shouldn't p be inside the log?
no, p is the pth root, for every while loop iteration we have o(p) loop, log ke anadar sirf search space ka size ayega basically while loop kitni baar chlega and while loop kitni baar chlega doesnt depend on p
We can also do like
while(lx){
high=m-eps;
}else{
low=m+eps;
}
}
return h;
can u tell me why we didnt put lo=mid and high=mid+1 in the video?? Is it cause we r dealing with decimals here and its multiplication...or its alright if u use high= mid+1 or high = mid
Bhaiya I have a query related to Software Development, Bhaiya I am doing this C++ course and side by side I am doing DS & ALGORITHMS in C++ only, Bhaiya I am in 2nd year and I want to know ki what I have to do in Software Development and should I continue on what I am doing or start to learn about development know? Also my teachers are telling me to shift to Java,but I like C++ batana Bhaiya kya karu?
do what you like
@@iamluv bhaiya Software Development ke liye kuch na karu phr?
This code is working fine for non perfect square no. But it's giving two diff val of hi and lo for perfect squ no.s
@@devkumar9889 no it's working fine for perfect square no. Also
4 decimal places ke difference toh minimum 0.0001 hota hai toh usko four zeroes kyu rakhe.....
please koi explain karo
Because if we want upto 4 decimal accurate answer then we need 4 zeros after decimal
someone explain the time complexity explanation
got it
Ur cf rating now?
Sir for practice questions , multiple coding platform use karna cahiye ya only codeforces, codechef, leetcode se hi acha se karna hai ? If u have any suggestions then please tell me .
use nay , main aim is to solve more questions do what you feel comfortable with.
1st view bhai!
First comment ❤️❤️
#include
#define int long long
#define ld long double
#define fi first
#define se second
#define vi vector
#define vvi vector
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define f(i,x,y) for(ll i=x; i>t;
ld eps= 1e-6;
// cout
Sequence, subsequence, subarray etc. of string aur array pr bhi questions bnaye bhaiya ji.🙏
Ye questions nhi bnte h mere se, aur bhut baar campus exam se out bhi ho chuka hu en sbhi questions ke karan 😞
there is not single technique to solve those kind of problems, generally those questions use concepts all over the place, there i no particular method to solve those problems. Almost of the time logic is different. Just read their solutions if you are not able to solve and you will understand what i am trying to say.
Thank you sir!
Bhai aapne BTech kiya h kya
check his linkedin profile from description
Channel ke about mei bhi likhaya hai derails
Why are we not doing here . Low=mid+epsilon ?
how is high = mid + epsilon making any sense ? , you are increasing the value of high ?, in case you meant low = mid + epsilon, we are not doing that here because we are dealing with doubles, if sqrt lies between mid and mid + eps, you will loose it.
@@iamluv yeah, I meant low only. I mentioned it this way since we wanted accuracy 10 times the epsilon. So why it will make any difference. Moreover, I came up with this idea from the trivial Binary search. Anyways I understood your explanation, thankyou for your time.
First view and comment
can you explain it again
👍👍❤️
💕❤️
AlexA STOP !!🤣😂😂😂
Just a comment to increase reach.
by the way who is Alexa
Samjha toh bhai ...itna toh hme bhi pta h .....kuch nye dhang se bta ...video nhi achi lagi😢
Bekkar video kuch samjh nhi aaya
really well explained