To those who are confused about how log works, it's basically like splitting a log. All it's asking is how many times do you have to split the big number by the small number to get down to 1. for example log base 2 of 4 basically means that you have to split 4 by 2 two times to get to 1. another example would be log base 4 of 64, you have to split 64 by 4 three times to get down to 1 single wood log piece.
@abdullahalaraz7404 Жыл бұрын
Thank you very much for this explanation. Now I understood how log works
@ahmadafghan6767 Жыл бұрын
explained better than the video itself.
@sharafat-karim Жыл бұрын
legend! thanks man
@t6hp11 ай бұрын
This is a brilliant analogy, thank you so much!
@LE-do5by10 ай бұрын
Thanks
@c4bantle12 жыл бұрын
Please do not stop making videos! You are the first person to explain this to me in a way I truly understand! Thank you so much!
@kantancoding2 жыл бұрын
I’m really happy that you understand now! Thank you 😊
@techhdan2 жыл бұрын
I've been programming for over a decade but never took the time to understand Big O notation. I landed a Google interview next month and I'm finding myself in a critical timeline to learn algorithms and Big O notation. These videos have been amazing at explaining these concepts very simply. I cannot thank you enough. This is amazing.
@kantancoding2 жыл бұрын
Congratulations! I’m glad that they are helpful. I’m sure you will do great 🙂
@WaldoTheWombat Жыл бұрын
How did your interview go?
@techhdan Жыл бұрын
@@WaldoTheWombat I unfortunately did not pass but they did say I'd be given another chance next year. My test had nothing to do with Big O notation but instead i had to do a breadth first traversal on a matrix and at that moment i hadn't studied graph algorithms. I'll be ready by next year! 🤜
@WaldoTheWombat Жыл бұрын
@@techhdan sorry to hear that, good luck next time. a matrix is a 2d array though, so what do graphs have to do with it?
@techhdan Жыл бұрын
@@WaldoTheWombat i was given a matrix with each element representing land or water. Given a coordinate find if the element is a lake and if so return the area of the lake. With a breadth first traversal you can count all the sorrounding water to get the area. Graphs can be represented as a multi dimensional array.
@whatya23013 жыл бұрын
You should know that your channel is soon going to grow crazy. Loved the content. Especially the graphic part and the tools used makes the concept so much more clear. More power to you.
@kantancoding3 жыл бұрын
Thank you. Your comment is encouraging. I’m glad that it helped you out!
@shubhanshusahuu4 ай бұрын
Best video to understand n log n
@Theodore23033 жыл бұрын
Watched your explanation on Big O of Log N, then I watched this. Now I understand! Thank you!
@kantancoding2 жыл бұрын
That's awesome! Great job and keep up the good work!
@thomasgipson71202 жыл бұрын
This helped me so much. Most creators don't go into O(log n) or O(n log n) but you did and you did it in a way that I was able to understand and retain. Thank you!
@kantancoding2 жыл бұрын
Thank you! Really happy to hear that 🙂
@markbarlescu18532 жыл бұрын
After 3 previous videos from other creators. Yours is the one that’s most coherent, and finally had it click for me. Thanks!
@kantancoding2 жыл бұрын
Happy to be a part of your aha moment 🙂
@TheRescue4study2 жыл бұрын
You are legend man.....!!!!!!!!!! FULL STOP. Tried to learn logarithms in time complexity no one ever explained log like you.
@kantancoding2 жыл бұрын
That’s awesome. When I was learning, the explanations didn’t work for me either. Glad you came to an understanding!
@mayankughade35852 жыл бұрын
Man, you just cleared off a reallly big QUESION MARK from my head !!!!!! Thanks a lot.
@kantancoding2 жыл бұрын
I’m glad to hear that! Keep up the good work 🙂
@AmeerHamza-mz3cg11 ай бұрын
Thanks, I finally understand O(nlogn). I never truly understood it in uni but this vid helped me alot. Stay Blessed 🥰
@kantancoding9 ай бұрын
Gotta love uni. The place where you pay to teach yourself 🫠
@maiaklimenko66142 жыл бұрын
I am 10 seconds into your video, and I already understand what n log n is. Wow, just wow
@kantancoding2 жыл бұрын
😂that’s awesome! I’m happy that you came to an understanding 🙂
@lillyput22752 жыл бұрын
U r just a life saviour🙇🏻♀️ may god bless u🧚🏻♀️
@kantancoding2 жыл бұрын
Happy to help 🙂
@demiguo31562 жыл бұрын
Your vids are one of the best cs topic explanation vids I've ever seen on the tube! You explain it so well and so clear, especially with your calm voice and incredible graphics. You made my life as a cs major college student so much easier, thank u!
@kantancoding2 жыл бұрын
I’m glad to hear that they are helpful to you 🙂 thank you!
@prakashpangeni81538 ай бұрын
You are awesome ! Simply brilliant 🙏 Never understood this until I encountered your videos... Please make more such videos to cover DSA topics.
@kantancoding8 ай бұрын
Hey! Thank you! I’m glad it helped. More algo & ds videos coming soon 😊
@eleandro2 жыл бұрын
You're so good in your explainations that I don't have any questions.
@kantancoding2 жыл бұрын
Hey, I’m glad it helped! Thank you 🙂
@JamieDawsonCodes2 жыл бұрын
I loved the code example + visuals for this. It's extremely easy to understand.
@kantancoding2 жыл бұрын
Awesome! Glad it helped you out 😎
@mobileminimaster30152 жыл бұрын
Great video man. Was dying without understanding what the hell they meant. Now I'm so clear. Thanks a ton.
@kantancoding2 жыл бұрын
Thanks 😊 , I’m glad that you understand it now!
@maguilecutty Жыл бұрын
How do you not have a million subs yet? Thanks heaps mate!
@kantancoding Жыл бұрын
Thanks! I’m glad you liked it 🙂
@sp3ctrums2643 жыл бұрын
Thank you! Your video made it so much clearer!
@kantancoding3 жыл бұрын
I’m really happy to hear that! 🙂
@unizfrhn28033 жыл бұрын
Wow bro. This is the best representation of this concept I've seen yet. Hats off.
@kantancoding3 жыл бұрын
I’m glad to hear that! Thank you 🙏
@charlesopuoro52952 ай бұрын
Thanks always for your clear explanations.
@kantancoding2 ай бұрын
Happy to help brother!
@NattapongPUN2 жыл бұрын
You were so clearly explain. Thanks
@suryak6573 жыл бұрын
Thanks for the video. It's been open unknown for me, you made it clear today. Thanks again !
@kantancoding3 жыл бұрын
Awesome! I’m glad that it helped 😆
@edenmeresman56192 жыл бұрын
I dont know but some videos have the subtitles in spanish!! Thanks you soo much for this videos. Speacking too you a system engenieer student from Argentina.
@kantancoding2 жыл бұрын
Hey! I’m glad they helped you 🙂
@mrutyunjayarout37893 жыл бұрын
You have explained it in the very nice way ...... belief me many pro cants explain the way u explained
@kantancoding3 жыл бұрын
☺️ that’s great to hear. Thank you !
@exheproject83622 жыл бұрын
+1point in my test tomorrow with this, thnx^^
@srinidhibandi2313 Жыл бұрын
Marvellous explaination!! HATS OFF
@kantancoding Жыл бұрын
Thanks! I’m glad it helped 😊
@iamsaytara3 жыл бұрын
Brilliant video. Thanks for easing this out for me ❤️
@kantancoding3 жыл бұрын
Of course! I’m glad it helped 😄
@thurmansanders3072Ай бұрын
Terrific explanation thanks !
@kantancodingАй бұрын
Thanks for watching! 😊
@teji_teji_ Жыл бұрын
Love this video so much. I though it was in base 10 this whole time like in regular math so I was so confused
@kantancoding Жыл бұрын
😂 yeah, seems like nobody really mentions that. I guess they think it’s obvious but it wasn’t obvious to me either when I was learning.
@Jezonista Жыл бұрын
Thank you for that video! Great explanation of the complicated concept!
@kantancoding Жыл бұрын
No problem! Happy to help 🙂
@ashokyadavfqplmgxjia4668 Жыл бұрын
love you bro from India. it really helpful thanks to make this one....
@kantancoding Жыл бұрын
Thanks bro! Happy to help
@Hurricane281102 жыл бұрын
Excellently explained
@msartist17672 жыл бұрын
Thanks so much for these clear explanations. One thing I think would be helpful to cover are code examples of the space complexity as well as the time complexity.
@Cos_Wayne Жыл бұрын
This is a great explanation, thank you!
@kantancoding Жыл бұрын
Thank you! I’m glad it helped you 🙂
@Marcus-cf2li Жыл бұрын
Thank you bro. Your contents are absolutely useful for me. I am also interested in software design and I found it in your channel.
@kantancoding Жыл бұрын
No bro. Happy to help 🙂
@9c_06_gedenararyaarunayoga28 ай бұрын
love from indonesia!!🔥🔥🔥
@julietonyekaoha4023 жыл бұрын
Great explanation. Keep it coming
@kantancoding3 жыл бұрын
Thank you very much! :) :)
@Lobogrey22 жыл бұрын
Explained this so clear for me thank you
@kantancoding2 жыл бұрын
Awesome! I’m glad it helped 🙂
@okeowoaderemi2 жыл бұрын
Christ it made so much sense now. Subscribed
@kantancoding2 жыл бұрын
I’m glad it helped!
@SRajalakshmiKsekar3 жыл бұрын
Excellent Explanation .Keep on going waiting for more videos in algorithm.
@kantancoding3 жыл бұрын
Thank you! More algorithm videos on the way 😉
@rar0000000009 ай бұрын
Great video. in the Future, i would use "print(1), print(2), print(3)... etc" instead of 'log' when talking about logs.
@kantancoding9 ай бұрын
Haha I remember when I was making these videos I thought.. hmm hope they don’t get confused with log for logging to the console and log in big o.. too many 🪵
@rar0000000009 ай бұрын
@@kantancoding It wasn't too confusing, but I did have to rewind a couple times haha. I was relearning Django recently so my brain had to do a reset from pythons print() vs console.log()
@RegularEverydayNormalGuy2 жыл бұрын
Instant subscribe man, the video is SO well done and easy to understand, it's amazing
@kantancoding2 жыл бұрын
I’m glad to hear that! Thank you 🙏
@mahamat_ali_youssouf2 жыл бұрын
Great explanation!
@dylanngo4454 Жыл бұрын
Thank you so much, very interesting info.
@kantancoding Жыл бұрын
No problem! I’m glad you liked it 🙂
@ben_jammin2422 жыл бұрын
Nice video. Maybe could bring up best and worse case complexity(ies) as well? The structuring of the video felt a little funny. Maybe it should just be a graphical/visual presentation with the voice overlay? Just an idea. Thanks for the vid!
@MrDangerousBOB3 жыл бұрын
BRO THIS VIDEO IS AWESOME! Keep up the grind bro
@kantancoding3 жыл бұрын
Thanks brother. I appreciate that! 🙏
@robinmathur58073 жыл бұрын
Explained very well with nice tool, great work and thanks
@kantancoding3 жыл бұрын
Thank you 🙏 I’m glad it was helpful!
@danielvandersand77892 жыл бұрын
you best bet I'm about to like and subscribe. Thanks my man, going to be a great resource through my CS academic career
@kantancoding2 жыл бұрын
Np! I’m glad it was helpful 🙏
@akmalbukhariev79326 ай бұрын
it is worth to smash the like button bro. Thank you
@kantancoding6 ай бұрын
Thanks for the support brother!
@volodymyrkredynets7842 жыл бұрын
I like your explanation, very understandable : )
@kantancoding2 жыл бұрын
Thank you🙂 I’m happy to help
@Babe_Chinwendum2 жыл бұрын
Thank you so much for the video
@kantancoding2 жыл бұрын
My pleasure 🙂
@aerospace_andy2 жыл бұрын
thank you, I understand it now!
@kantancoding2 жыл бұрын
I’m glad🙂 keep it up!
@HzHzHzHz1113 жыл бұрын
great explanation, one quick suggestion i have is add links to videos you're referring to in the video description (i.e logn explanation video) thanks!
@kantancoding3 жыл бұрын
Good point. I will try to go through these videos and add the corresponding links. Thanks for the feedback!
@zap71403 жыл бұрын
Bro, Your video is helpful.
@kantancoding3 жыл бұрын
Thanks! Happy to help brother 🙏
@asmith79073 жыл бұрын
These videos are amazing, good stuff
@kantancoding2 жыл бұрын
Really happy to hear that! Thank you
@planetofzakir9712 жыл бұрын
Great Explanation ❤
@kantancoding2 жыл бұрын
I’m glad it helped you! 🙂
@Gyooopp Жыл бұрын
you got a new subscriber
@kantancoding Жыл бұрын
Welcome! 😊
@bartek61002 жыл бұрын
thx a lot man! helped so much, appreciate!
@kantancoding2 жыл бұрын
Happy to help brother 🙂
@mattp64603 ай бұрын
thank you very much
@kantancoding3 ай бұрын
Pleasure!
@tavleenkaur83252 жыл бұрын
THANK YOU SO MUCH!
@kantancoding2 жыл бұрын
Of course! My pleasure 🙂
@Dangerdog30003 жыл бұрын
This was great dude, thank you
@kantancoding3 жыл бұрын
No problem! I’m glad it helped 🙂
@anaybaid Жыл бұрын
This is soo helpful man!! :)
@kantancoding Жыл бұрын
Awesome! I’m happy to hear 🙂
@anaybaid Жыл бұрын
@@kantancoding Thanks! :)
@amentothatt3 жыл бұрын
so well explained!
@kantancoding3 жыл бұрын
Thank you!
@jokesnerd91222 жыл бұрын
Amazing stuff
@kantancoding2 жыл бұрын
Thank you for your kind words 🙂
@ashokyadavfqplmgxjia4668 Жыл бұрын
keep it up.........
@Dhanushsaji2 жыл бұрын
Thank you
@akmalbukhariev79326 ай бұрын
very good brother.
@kantancoding6 ай бұрын
Thank you 😊 I’m glad that it helps!
@mammutti3000x3 жыл бұрын
thank you!
@kantancoding3 жыл бұрын
My pleasure 😆
@nquanta15483 жыл бұрын
Got a new subscriber bro ,nice video👍❤️
@kantancoding3 жыл бұрын
Thank you sir 🙏🙂
@adilismail3593 Жыл бұрын
Thanks❤
@kantancoding Жыл бұрын
Happy to help ❤️
@kostabakalinov12373 жыл бұрын
very helpful!
@kantancoding3 жыл бұрын
Thank you!
@yebonbyun7648 Жыл бұрын
Thanks for super helpful video. I have one question. According to the previous videos, we consider the worst case or highest order part of the function. But what does it become O(n) times O(log n) instead of just O(n)? Thanks in advance!
@kantancoding Жыл бұрын
No problem! 😊 And to answer your question, it’s not just O(n). It’s O(n) at every level and there are log n levels 😉
@penlavits33053 жыл бұрын
didn't understand why exactly it works but i understand the math
@hippohugz99663 жыл бұрын
thankyou so much
@kantancoding3 жыл бұрын
My pleasure! I’m happy to help 🙂
@AwaraGhumakkad3 жыл бұрын
Its a very nice video but had one question anyone can answer - for the inner loop I believe complexity should have been - O(1), O(2), O(3) ........ and so on , then we can generalize that to O (n). instead here it has been shown as log(1), log(2) and so on ...... then generalization would be log(n). but log(n) is for out loop which is correct. please suggest
@kantancoding3 жыл бұрын
Thank you!. Regarding your question, I think you are confusing the console.log() call in the visualization with the complexity.
@anjildhamala49962 жыл бұрын
@@kantancoding haha. That is super easy to be confused about especially since we are trying to understand logarithmic functions and every time you see log(x) you think logarithmic rather than shorthand notation for console.log.
@kentsang93762 жыл бұрын
omg thank you so much
@kantancoding2 жыл бұрын
Happy to help 🙂
@sagarghare98292 жыл бұрын
Thanks, buddy for such the best videos. You explain very well. Are you of Indian origin?
@kantancoding2 жыл бұрын
Hey thanks! I’m American 🙂
@abldaz. Жыл бұрын
Good video !
@kantancoding Жыл бұрын
Thank you! Thanks for watching 😊
@hikamiawnyan Жыл бұрын
Thanks man
@kantancoding Жыл бұрын
My pleasure 🙂
@CROXoDyLE2 жыл бұрын
I really do enjoy this video and appreciate your work, but going forward I highly recommend reducing the amount of jittering in the animations it was a bit distracting.
@kantancoding2 жыл бұрын
😂🤣 yeah, unfortunately the software I used was pretty 🗑 so I couldn’t remove the jittering 🤷♂️
@aat5012 жыл бұрын
@@kantancoding I thought it was fine. thanks for the video
@Danfin1236 ай бұрын
thank you brooo!!!!!!1
@kantancoding5 ай бұрын
Any time brother 😊
@iamthatsid3 жыл бұрын
Thanks bro !
@kantancoding3 жыл бұрын
My pleasure brother😆
@sou35982 жыл бұрын
thanks a lot for your video. Was wondering how a merge sort is actually O(n log n) ? I mean for dividing is O(n log n) so the other n is for comparing elements ? How’s that ?
@kantancoding2 жыл бұрын
Hey, to understand this, try to think about a simpler problem, merging two sorted lists. merging two sorted lists is O(n+m) where n and m are the sizes of the two sorted lists. So we need to touch every element in both n and m to merge them and maintain the sort. Now think about what we are doing at every level with merge sort. We are merging at most n sorted lists (the bottom most level) and at every level, regardless of the number of sorted lists we are merging, the total number of elements in all of the lists on that level is n. So we need to touch n elements at every level. There are log n levels so complexity is O(n * log n)
@MrSunmorning Жыл бұрын
Can you do some run time comparison between merge sort and fibonacci? Given that merge sort split the input in halves on each level of recursion, so we will have nlog(n) run time. When I draw out the recursion calls (like a tree structure), I see that fib look quite similar to merge sort, but fib run time will be 2^n. I think because the input size of the fib recursion calls not reducing so fib is not going to be a log run time. However, I still have hard time wrapping my head around this.
@kantancoding Жыл бұрын
There’s already a video in this series that explains Fibonacci time/space complexity 👍
@mohammedalgaradi86613 жыл бұрын
great tutorial, what software you use to make the presentation ?
@kantancoding2 жыл бұрын
I actually don't remember the name of the software that I used for this. I remember I googled "best whiteboard animation software" or something like that and just picked the one with the best ratings 😎
@anjildhamala49962 жыл бұрын
So, this is pretty obvious when one specifies a value to n (preferably small) and then evaluate how many times it is ran. Is there any pitfall to this approach?
@Mr_TheMan Жыл бұрын
thx
@kantancoding Жыл бұрын
No problem!
@magzhanabdibayev38183 жыл бұрын
Great video. A short and understandable explanation.
@kantancoding3 жыл бұрын
Thank you! I’m glad that you liked it 😆
@bhupendra84292 жыл бұрын
Can you explain about O(n*m),O(n+m) something like that, I have seen this O in leet code time complexity test
@kantancoding2 жыл бұрын
They are probably just using n and m to represent two different inputs. This video might help you understand what I mean kzbin.info/www/bejne/qHmwZK2NnNODjKM
@FitnessChaos3 жыл бұрын
Good vid mate
@kantancoding3 жыл бұрын
Thank you! I’m glad it helped 😆
@ninadpradhan65663 жыл бұрын
What tool did u use to create this transparent white board video ? Any information is appreciated
@kantancoding2 жыл бұрын
I think you can just google "best whiteboard animation software." That should put you on the right track.
@ninadpradhan65662 жыл бұрын
@@kantancoding thanks man
@sameerroshan954211 ай бұрын
O (log N) works for this example but O(n/2) also works for the top level loop which makes it O(n) soo how do you pick log here??
@kantancoding11 ай бұрын
I’m sorry but I don’t understand what you mean. I explain why it’s O(n log n) in the video. Which part specifically is confusing you?
@sameerroshan954211 ай бұрын
@@kantancoding The top loop is O(log N). But it can also be O(N/2) right? if not, why can't it be O(N/2) ?
@ProvakorKonik3 жыл бұрын
Awesome............ Subscribing to you...
@kantancoding3 жыл бұрын
Thank you! I’m glad it helped!
@JuanGarcia-dg8zc6 ай бұрын
so its log n complexity because instead of going through full size of input n we're cutting it in half?? just wanna clarify!!!
@kantancoding6 ай бұрын
Hmm not really. This is n log n. I suggest watching the entire series 🙂
@loganhawkins64863 жыл бұрын
How do you find the time complexity of O(nlogn)
@goldentitan3112 жыл бұрын
nice
@kantancoding2 жыл бұрын
Thank you 🙂
@r20de202 жыл бұрын
3:22 "Log is always the base of 2". Oh come on! Why does every field have different notation? "Log x" in standard math means base 10, "Log x" in WolframAlpha means natural log, so base e, and now in the computer science there's a base of 2? I mean, yeah, seems logical, because binary... however the lack of unification is horrifying ;-; you can never be sure, if you see just an equation. But anyway! Good video, learnt a lot! :D
@kantancoding2 жыл бұрын
😂🤣 Thank you! I understand your frustration
@BBTALKZ2 жыл бұрын
So if there’s a while loop and a for loop would that be a n log n then?
@kantancoding2 жыл бұрын
Not necessarily. Depends on the algorithm. A while loop can be an infinite loop. What is the for loop iterating on? You have to diagnose each algorithm individually. Don’t make the mistake of assuming the complexity of an algorithm based on surface level things like the number for nested loops or whatever. Really look at the input and see how it is scaling.