Bubble Sort | C++ Example

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

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

  • @chezchundy8892
    @chezchundy8892 Год назад +8

    I'm a total beginner working thru cs50 and your videos have been invaluable in helping me further understand the concepts i'm being introduced to. Thanks so much for taking the time to make these.

    • @PortfolioCourses
      @PortfolioCourses  Год назад +4

      You’re very welcome, thanks for sharing with me that these videos are helping you out on your journey. Good luck going forward as you continue to learn! :-)

  • @lucasgroves137
    @lucasgroves137 Год назад +8

    How lucky, bubble sort in C++ is exactly what I'm looking for today. 👍

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

    This is super helpful while studying Algorithms in a CS diploma and trying to move to that field. Thank you!

  • @valor36az
    @valor36az 8 месяцев назад +1

    Thank you so much best C++ tutorials!

  • @nikolaykulov4070
    @nikolaykulov4070 Год назад +1

    Thank you! That's the best video about Bubble Sort that I've ever seen!

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

      You’re very welcome, I’m glad it’s your favourite bubble sort video! :-)

  • @Life17768
    @Life17768 9 месяцев назад +2

    I was fed up with after i watched your video, i understood that ver well. Good explanation. Thank you ❤️💪🏼

  • @om9.8dclash81
    @om9.8dclash81 5 месяцев назад +2

    Thankyou Sir, this lecture really helped me out🙏

  • @peterbertels7569
    @peterbertels7569 Год назад +2

    Amazing Video!! The best explanation I've seen

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

      I'm really glad that you enjoyed the explanation! :-)

  • @nouramsaeed
    @nouramsaeed 3 месяца назад +2

    Thankes for this more than great explination, but I did not get the Optimization part! the code was easier before?

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

      The optimization allows it to exit the loop once the elements are no longer being swapped. It keeps it from always running both loops to completion, even when the sorting is finished. It makes the code a bit more complex, but safes time, especially for larger data sets. Although, out in the wild, bubble sort is not something but you will ever be using.

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

    Great video! Love from Bangladesh.

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

    Well Explained, very educational

  • @ПауверТзен
    @ПауверТзен Год назад

    please make playlist with algorithms and data structure you're the best tutor for me

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

      I definitely want to keep covering more algorithms and data structures. :-)

  • @VladimirSmith
    @VladimirSmith Год назад +2

    Excellent educational video! Been looking for something like this forever, but now I have found it. Thank you sir!

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

      You're very welcome Vladimir, I'm glad you found the video and that you enjoyed it! :-)

  • @AmitZanzuri-h8p
    @AmitZanzuri-h8p 8 месяцев назад

    Thank you for the great content. Quick question - since the last element can’t be compared to the element to the right of it, wouldn’t it be more handy to start with j=1 and then compare each element to the element on the left? Is there any problem with doing so?
    for (int i=0; i

  • @dev_ression
    @dev_ression Год назад +2

    thank you bro

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

    bro,your videos are very helpful.
    but an humble request is make a playlist on data structure and algorithm .

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

      Good idea Partho! :-) A playlist on data structures and algorithms in C++? Or a playlist on data structures and algorithms in general?

    • @ПауверТзен
      @ПауверТзен Год назад

      @@PortfolioCourses please only in c++. I will go to republican olympiad and it will be very helpful for me!

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

    Hi, if selection sort, inserction sort and bubble sort have all the same time complexity, how do I choose between the three? it doesn't matter? (ofc ig in production I wouldn´t use this algorithms but I'm in college and I have to, but since all three seems equally inneficent, i would't know which one to use, maybe bubble sort because it may run less times than the other two)

    • @PortfolioCourses
      @PortfolioCourses  Год назад +2

      Bubble sort we basically never use in practice. :-) I have heard that insertion sort is sometimes used when sorting small arrays. So for example, in some implementations of quicksort, when the portion of the array being sorted is small enough we may use insertion sort to sort the array. As to exactly why one is faster than the other... technically they are all n^2 complexity, but I think in practice we find there is performance differences with experimentation, like this article: medium.com/the-high-performance-computing-forum/performance-comparison-between-selection-insertion-and-bubble-sorts-d670d874be70.

  • @nokia_n-gage
    @nokia_n-gage Год назад

    Thank you!

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

    Can u suggest me a light ide for my low end pc BTW Excellent lecture !

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

      I'm glad you enjoyed it! :-) Regarding an IDE, maybe Visual Studio Code with the C++ extension? code.visualstudio.com/docs/languages/cpp

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

      @@PortfolioCourses Thanks I will try it 👍🏻

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

    What IDE you use for C++ ?

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

    Nice man

  • @divthecreator
    @divthecreator 8 месяцев назад +1

    University of Nigeria exam question

  • @devon_claude_4636
    @devon_claude_4636 3 месяца назад

    I'm writing in 2 hours 😅😅😅 ii get it