Bubble Sort | C++ Example

Поділитися
Вставка
  • Опубліковано 20 січ 2025

КОМЕНТАРІ • 43

  • @chezchundy8892
    @chezchundy8892 Рік тому +10

    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 Рік тому +10

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

  • @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! :-)

  • @valor36az
    @valor36az 10 місяців тому +1

    Thank you so much best C++ tutorials!

  • @Life17768
    @Life17768 11 місяців тому +2

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

  • @peterbertels7569
    @peterbertels7569 Рік тому +2

    Amazing Video!! The best explanation I've seen

  • @t6hp
    @t6hp Рік тому

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

  • @om9.8dclash81
    @om9.8dclash81 7 місяців тому +2

    Thankyou Sir, this lecture really helped me out🙏

  • @nouramsaeed
    @nouramsaeed 5 місяців тому +2

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

    • @MarcusHCrawford
      @MarcusHCrawford 3 місяці тому

      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 Рік тому

    Great video! Love from Bangladesh.

  • @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! :-)

  • @dev_ression
    @dev_ression Рік тому +2

    thank you bro

  • @AmitZanzuri-h8p
    @AmitZanzuri-h8p 10 місяців тому

    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

  • @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. :-)

  • @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!

  • @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!

  • @watchuneed570
    @watchuneed570 Рік тому

    What IDE you use for C++ ?

  • @Gazab_GFX
    @Gazab_GFX Рік тому

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

    • @PortfolioCourses
      @PortfolioCourses  Рік тому

      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 Рік тому

      @@PortfolioCourses Thanks I will try it 👍🏻

  • @shegzfresh6555
    @shegzfresh6555 Рік тому

    Nice man

  • @divthecreator
    @divthecreator 10 місяців тому +1

    University of Nigeria exam question

  • @devon_claude_4636
    @devon_claude_4636 5 місяців тому

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