A&DS S01E01. Algorithms. Time complexity. Merge sort.

Поделиться
HTML-код
  • Опубликовано: 4 фев 2025

Комментарии • 102

  • @KumarHarsh95
    @KumarHarsh95 6 дней назад

    Subscribing to you is the least of the support I can extend for this amazing series

  • @grvkmr07
    @grvkmr07 4 года назад +90

    Thanks for the tutorials in English, pashka! orz

    • @vinoddiwan5792
      @vinoddiwan5792 4 года назад

      agree , we need in english

    • @larknoone565
      @larknoone565 4 года назад

      orz means what ?

    • @Aditya_20
      @Aditya_20 4 года назад +1

      @@larknoone565 a posture emoticon representing a bowing

  • @vijaysharma9946
    @vijaysharma9946 3 года назад +4

    A friend recommended me this video, and I've been blessed.

  • @пашашевелёв-д9м
    @пашашевелёв-д9м 4 года назад +6

    Я готов это пересматривать, этот курс, по много раз(новый учебный год , новый пересмотр), даже когда ты говоришь на инглише и при этом я не понимаю, что ты говоришь))
    Спасибо Огромное За Видео!

  • @damndontcare8970
    @damndontcare8970 Месяц назад +6

    I am here to learn cause your student suggested to come here. Thank you for this !

  • @alirezaasadi8656
    @alirezaasadi8656 10 месяцев назад

    THIS IS THE BEST COURSE EVER .THANKS SENPAI.

  • @ronyWeeb
    @ronyWeeb 4 года назад +6

    I am here from KGP queries page...this lectures are absolute gold...Thank you sir.

  • @Mit_Bambhroliya
    @Mit_Bambhroliya 11 месяцев назад +3

    thank you for such a precious course for the student who can't able to study at big university. Big Thanks From The INDIA..............

  • @mananshah2140
    @mananshah2140 4 года назад +6

    I enjoyed the lecture and the sounds you made. Keep up the good work and also design challenging and interesting assignments!

  • @vamsia5543
    @vamsia5543 4 года назад +10

    Most awaited 🔥💜

  • @chuka231d8
    @chuka231d8 4 года назад +47

    Content of this lecture:
    1. What is algorithm?
    2. Definition of Time and RAM complexity
    3. Big O notion, Big Omega notion, Big Theta notion
    4. Bunch of time complexity samples (Linear, Root, Log, Recursive Functions)
    5. Insertion Sort (Intro, Pseudo code, Time complexity)
    6. Merge Sort (Intro, Pseudo code, Time complexity)
    7. Time complexity analysis of general divide & conquer algorithm (Recursive & Merge)

    • @theresweet984
      @theresweet984 3 года назад +1

      it will be nice if you add timelines into your description )

    • @chuka231d8
      @chuka231d8 3 года назад +1

      @@theresweet984 I will try :)

  • @josebaiturregui37
    @josebaiturregui37 2 года назад +1

    I have to give it to you... I think the video started slow paced and kinda confusing and hard to follow but i gotta give it to you as time passes it gets really interesting.. way to go.. keep'em coming good work!!

  • @subhranshudas8862
    @subhranshudas8862 15 дней назад

    Thank you Maestro!
    - future generations

  • @subidmajumdar8690
    @subidmajumdar8690 4 года назад +7

    Thank you, please complete this series. I promise I'll finish them and learn something. Thanks

  • @Sranju23
    @Sranju23 Месяц назад

    At 12:24, when he asked if anyone knows what RAM stands for, I couldn’t resist the urge to proudly say, ‘Random Access Memory!’
    It was always a common question on my exams when I was a kid. Haha, good times!

  • @ankitbytes
    @ankitbytes 4 года назад +2

    Thank you sir, could not be more indebted!

  • @runtime379
    @runtime379 4 года назад +3

    Much awaited course ....❤️
    But , be continuous while uploading lectures ✨

    • @yozaam
      @yozaam 4 года назад

      you can watch friday at 8:30 IST live

  • @piyushnaithani7689
    @piyushnaithani7689 4 года назад +1

    Ohh mai... Finally I can take more knowledge easily😁

  • @kalindigupta5547
    @kalindigupta5547 4 года назад +2

    Woah that guitar intro is soo cool I just watch the video again and again to see that intro 🙃🙃

  • @shaswatsingh
    @shaswatsingh 4 года назад +5

    great lecture man, You just looks like Edward Snowden brother

  • @Code_Note
    @Code_Note 4 года назад

    Thanks for the lectures and ur time 😀 ,
    Love from India

  • @varunjoshi6928
    @varunjoshi6928 4 года назад

    You are doing God's Work here, Thank You

  • @koustav6884
    @koustav6884 4 года назад +2

    Thank you for English sirr keep uploading

  • @hima1310
    @hima1310 Год назад

    really good learning experience

  • @mahmoudalsayed1138
    @mahmoudalsayed1138 Год назад

    Examples end at 53:44
    Sorting algorithms start at 53:45

  • @mamaafrica2512
    @mamaafrica2512 3 года назад +2

    why did you write "if b = m" in merge sort 1:11:22 as the types of b and m doesn't match each other?

  • @abcd-sf5ur
    @abcd-sf5ur 4 года назад +1

    You are next to god sir

  • @subidmajumdar8690
    @subidmajumdar8690 4 года назад

    I'm ready for this

  • @kaleabasfaw9734
    @kaleabasfaw9734 4 года назад +4

    That cat made me subscribe. :)

  • @nihalk5315
    @nihalk5315 4 года назад

    Playing guitar well, ♥️. thanks for this lectures

  • @mayurkoli4145
    @mayurkoli4145 4 года назад +1

    Thanks you my friend

  • @AjayPrajapati-cz2oz
    @AjayPrajapati-cz2oz 2 года назад

    54:00 sorting algorithms

  • @pittyconor2489
    @pittyconor2489 3 года назад

    so excited to get my rank to rise by 2k points in the next 2 years

  • @sachinchoudhary9874
    @sachinchoudhary9874 4 года назад

    Thanks alot. Was waiting eagerly 💜

  • @richardxu9843
    @richardxu9843 Год назад

    Some cases are missing: if f(n)= O(n^logba* (logn)^c), c > 0, then T(n)= f(n)*logn

  • @franky0226
    @franky0226 4 года назад

    Man you are the Best!!!

  • @tarunmali2424
    @tarunmali2424 3 года назад +1

    Which is the other series for Cp can someone provide the link?

  • @prajwalchoudhary4824
    @prajwalchoudhary4824 4 года назад

    you are the best

  • @sawanpatel9421
    @sawanpatel9421 4 года назад +1

    noice sir..................keep it up

  • @tonystarc9567
    @tonystarc9567 4 года назад +1

    Please do continue to post the videos in English...

  • @TechWithKomal
    @TechWithKomal 3 года назад +1

    @pavel
    What will be time complexity of this solution:
    class Solution{
    private: int count = 0;
    public:
    int pathSum(TreeNode* root, int targetSum)
    {
    recurse(root, targetSum, false);
    return count;
    }
    void recurse(TreeNode* root, int sum, bool must)
    {
    if (root == nullptr) return;
    if (root->val == sum) { count++; }
    if (!must)
    {
    recurse(root->left, sum, false);
    recurse(root->right, sum, false);
    }
    recurse(root->left, sum - root->val, true);
    recurse(root->right, sum - root->val, true);
    }
    };

    • @TechWithKomal
      @TechWithKomal 3 года назад

      Surely it is required to be in pow(4, something)
      But what would be value of that something...
      Bcoz I'm unable to get depth of recursive tree

  • @madhukiranattivilli2321
    @madhukiranattivilli2321 3 года назад +1

    1:03:00 -- Is O(best case) same as omega Ω(f(n)) ?

    • @pavelmavrin
      @pavelmavrin  3 года назад

      No, Ω(f(n)) is the asymptotical lower bound for the function, same as O(f(n)) is an upper bound. We use both these bounds to analyse the worst case time complexity. We use O when we want to prove that the algorithm is fast, and use Ω to prove that the algorithm is slow, but both for the worst case

    • @madhukiranattivilli2321
      @madhukiranattivilli2321 3 года назад

      @@pavelmavrin I read on geeksforgeeks that big-omega represents lower bound & best case, and big-O represents upper bound & worst case, and big-theta represents average case. But I guess geeksforgeeks docs are being written by public. I'll take ur word. Thanks :)

  • @wolfie-1812
    @wolfie-1812 4 года назад

    pashka orz

  • @bhargabdhungel9341
    @bhargabdhungel9341 11 месяцев назад

    awesome :)

  • @amanvaibhavjha9304
    @amanvaibhavjha9304 Год назад

    hey ,
    can i start my algo journey from here , with having some knowledge of syntax in cpp or you suggest me some other way.
    Also, should i follow clrs along with this course?

  • @ADiLetJoldoshbekov
    @ADiLetJoldoshbekov 3 года назад +1

    Hi Pavel,
    On the task I can't get what is the // symbol meaning:
    for i in range (n ) :
    j = i
    while j > 0:
    j = j // 2

    • @TechWithKomal
      @TechWithKomal 3 года назад +1

      It surely means integral division, if pseudo code was in context of python language

  • @abduqodir4046
    @abduqodir4046 2 года назад

    Good

  • @parayaswanthchakravarthi
    @parayaswanthchakravarthi 10 месяцев назад

    sir Could you plz explain time complecity of recursion f(m,n) = f(m-1,n)+f(m,n-1)+O(1) of this type

  • @mohob-b6r
    @mohob-b6r Год назад

    Is there a textbook required for this course?

  • @RahatSamit
    @RahatSamit 3 года назад

    m-ary tree height is log_m(n), so Ternary tree of n nodes should have a log_3 (n) height.

    • @pavelmavrin
      @pavelmavrin  3 года назад +1

      that's correct, so what is your question? in lecture we had ternary tree, but its height is log_2(n), so the number of nodes is not n.

    • @RahatSamit
      @RahatSamit 3 года назад

      @@pavelmavrin why the height of the ternary tree is log_2(n)? What is the reasoning behind the base being 2 in the video? Not 3.

    • @pavelmavrin
      @pavelmavrin  3 года назад +1

      because the recursion in the example that we discuss goes from n to n/2

    • @RahatSamit
      @RahatSamit 3 года назад +1

      @@pavelmavrin I get it now. It depends on the scale function of n per level, so height remains the same as the binary tree. It needed few more words though. You have demonstrated things in detail. So here, drawing the relationship of the base with the branches and the scale function, might have made it more easy to follow. I was lost at this point. The rest was a breeze. Thank you for the effort. :clap:

  • @subidmajumdar8690
    @subidmajumdar8690 4 года назад

    It'll be very very very helpful for Students like us if you sire add the english subtitles on your past videos (they're in Russian language)

  • @sanskarbhargava1842
    @sanskarbhargava1842 4 года назад +1

    🔥🔥🔥

    • @sawanpatel9421
      @sawanpatel9421 4 года назад

      bhai do saal tak to clg hi khatam ho jayegi...........

    • @sanskarbhargava1842
      @sanskarbhargava1842 4 года назад

      @@sawanpatel9421 bachegi bhai college 7th sem tak rev hota rahega

    • @sawanpatel9421
      @sawanpatel9421 4 года назад

      @@sanskarbhargava1842 7th tak to apan hi cm hoge to iske lecture kyu dekhge........

    • @sanskarbhargava1842
      @sanskarbhargava1842 4 года назад

      @@sawanpatel9421 haan waise yeh bhi sahi hai 🔥🔥🔥

    • @GautamKumar-lh7ul
      @GautamKumar-lh7ul 2 года назад

      @@sanskarbhargava1842 shi lecture hai kya ... follow karna chahiye kya?

  • @nitishpandey9822
    @nitishpandey9822 3 года назад

    Where can I get solutions to the home task problems ?

  • @thinker8190
    @thinker8190 Месяц назад

    ‏‪1:02:34‬‏ the worst case should be n! , No? 🤔

  • @interested_in_everything
    @interested_in_everything 4 года назад +1

    Thanks for this amazing content. Please do beginner videos also!

  • @shrayammitra6447
    @shrayammitra6447 4 года назад

    Can't thank enough

  • @oximas-oe9vf
    @oximas-oe9vf 11 месяцев назад

    ohhhhhh my GOOD

  • @ZERINSHAIMAMEEM
    @ZERINSHAIMAMEEM 4 года назад

    Great :D

  • @mouhannadal-hmedi1501
    @mouhannadal-hmedi1501 4 года назад

    thank you so much sir , please please please add subtitle

  • @Sanya_paket
    @Sanya_paket 4 года назад

    Nice

  • @noone36101
    @noone36101 3 года назад

    Day 1 Notes:
    Big O notation,omega notation and theta notation

  • @himanshu_27tt
    @himanshu_27tt 3 года назад +2

    Is this course in c++

  • @madhukiranattivilli2321
    @madhukiranattivilli2321 3 года назад +1

    Hi Pavel,
    About "worst case lower bound" Ω(op) vs "worst case upper bound" O(op)…
    In Big-O lecture, U've used the example of f(n) = 5 + 2n to define O(op) and Ω(op)
    I'm unable to clearly understand what exactly Ω(op) represents!
    Is there any popular algo with different upper and lower bounds in worst case?
    If yes, cud u pls write them. I might understand better
    Thankyou! :)

    • @pavelmavrin
      @pavelmavrin  3 года назад +4

      Let's say the worst case time complexity of your algorithm is T(n) = 5 + 2n.
      You may say that T(n) = O(n²), that's absolutely correct statement, also you can say that T(n) = O(n log n), that's also correct. From the other side, you may say that T(n) = Ω(log n) or T(n) = Ω(sqrt(n)), and so on.
      If you have the same function in O and Ω, it means you actually found the tight bound of your function, there is even a special letter for this case Θ, so T=Θ(n) just means that T=O(n) and T=Ω(n).
      So if your O and Ω bounds are different, it just means you don't know the actual complexity of your algorithm, but you know it is between these two functions.
      All algorithms we discuss in this course are well studied, so it does not happen.
      On the other hand, in practice you usually care only about upper bound. For example, if you prove that your time complexity is O(n log n), it means your program will make at most c log n operations. If it is good enough for you, it's fine. Even if real time complexity is Θ(n loglog n). You don'n need to know the real time complexity, you only need to know, that it is fast enough.
      Hope it helps)

    • @madhukiranattivilli2321
      @madhukiranattivilli2321 3 года назад

      ​@@pavelmavrin I think I totally understood now. Thanks for ur "patient writeup" :)
      I got confused because while computing worst case time complexity for "stage 1 OPs find() & union()" of Disjoint Sets, u wrote on board T(n) = Ω(n²), but not T(n) = O(n²)
      Now I understand from ur explanation that upper and lower bounds would be usually the same for popular DSes and ALGOs, and even if they are different we're mainly interested in upper bound, and even if we wanna compute lower bound, we can do the following :
      First compute the upper bound. To start with, assume lower bound is same as upper bound, and check via "induction" if we get valid values for 'n' and 'c', and also check via "common sense approach" if such lower bound makes sense for the problem (whatever problem is being analyzed)
      Thankyou! :)

  • @priyaraj4735
    @priyaraj4735 4 года назад

    Can someone tell me which course he was talking about for competitive programming at codeforces at the beginning?

  • @jokerguy7054
    @jokerguy7054 4 года назад

    thank you very much sir!!

  • @rumazius
    @rumazius 4 года назад

    Интро топ

  • @sovulken
    @sovulken 4 года назад +2

    well, again twenty five...

  • @aminhlel7241
    @aminhlel7241 2 года назад

    so sad that ur content is in russian 😢!