Algorithms Explained in 30 seconds: Bubble Sort 👩‍💻

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

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

  • @CodingWithLewis
    @CodingWithLewis  2 года назад +67

    New series :) What do you think? 🤔

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

      Amazing!!

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

      Ya some basic concepts in short will be good and specially for quick revision specially this one most dev forget it as we never use this in most applications.
      If possible do make a playlist

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

      Need more of these

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

      I didn't even know that! 😅

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

      Dude, your channel is one of the best cheatsheet on RUclips ever!

  • @vikrantsatpute9984
    @vikrantsatpute9984 2 года назад +114

    Please make a video on algorithms and data structures, it was one hell subject during my 2nd semester

    • @CodingWithLewis
      @CodingWithLewis  2 года назад +24

      Absolutely!

    • @solarchat9413
      @solarchat9413 2 года назад +7

      A video? Bro, isn't this the core of tech interviews. It would take a whole playlist 🥲

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

      @@CodingWithLewis could you make a vid about radix sort, if I remember correctly that is the fastest sorting algo there is and it would make an interesting video. :)

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

      Please

  • @islandcave8738
    @islandcave8738 2 года назад +22

    I learned bubble sort before getting into programming. I first used it in Pokemon Yellow, to sort my Pokemon. You could only sort one swap one pair of pokemon at a time, so bubble sort was the way you had to do it.

  • @platimus7984
    @platimus7984 2 года назад +21

    This is such a good idea! Can you do the same with data structures?

  • @8koi245
    @8koi245 2 года назад +41

    maybe use it, then charge more for code improvement 💀

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

    I think C is one of the best Languages because of its flexibility. There is literally nothing you can't write in C. For example i am really interestet in Computer architecture and for some concepts like Paging and MMIO it really just helped writing a small kernel to implement these concepts. Guess what Language i used besides Assembly.

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

      Plus, if you know C you can learn other languages more effectively

  • @g4mmalotus937
    @g4mmalotus937 2 года назад +2

    I play a game called 7 Billion Humans and honestly this is the only way I could figure out how to solve certain puzzles

  • @ivanthealien
    @ivanthealien 2 года назад +2

    After you put the 8 in the last spot you start comparing at the beginning again and you keep going until you get to the 5 and 4 to be switches.
    The way the animations shows, after 8 is placed it just goes straight to the 4 and 5. Which is wrong.

  • @-Corvo_Attano
    @-Corvo_Attano 2 года назад +2

    Your videos are really helpful man👑Subscribed ❤️

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

    The simple way to write a code, is most of the best way to write your code. No one going to care about the code behind as long your program does not take too long to load.

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

    Thank you sir

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

    I love these types of quickly explained alghoritms

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

    We need more project ideas

  • @All-jl8yi
    @All-jl8yi 2 года назад

    Fun fact that bubble sort could be faster than other on small arrays ;)

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

    Really needed this. Please also make merge sort, quick sort and hashing. As someone who is learning really appreciate this.

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

    Hashes best way to go if you know the possible values. Binary sort if you don't

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

    Please try covering the topics of Discreet Mathematics... It will be coming on my second semester..

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

    Great idea. More please 😀

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

    Ok I like this guy👍

  • @j.r.r.tolkien8724
    @j.r.r.tolkien8724 2 года назад

    I like the brief explanation

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

    At first I was using Bubble Sort and getting TLE all over the places 😂

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

    What’s the next best one then? I only know bubble sorting from school 😆

    • @sumitvishwakarma1075
      @sumitvishwakarma1075 11 месяцев назад +1

      quicksort algorithm is the most efficient algorithm for sorting elements

  • @syedsohail6878
    @syedsohail6878 7 месяцев назад

    Do you have playlist for algorithm in simple way

  • @me-ld2gq
    @me-ld2gq 2 года назад

    If i were five i would have lost it at the point where you said list of objects and algorithm and obama.

  • @Braeden.F
    @Braeden.F 2 года назад +1

    That's not explaining it like someone's five, that's just how you explain it. It's literally just that simple

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

      Its almost like the concept is already simplified, and thats the point

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

    2 for loops in C and u are done
    Or even one

  • @rodrigoqteixeira
    @rodrigoqteixeira 5 месяцев назад

    I literally made one faster stable sorting algorithm (O(n sqrt n)) when playing arround with a sorting algorithm showcaser.

    • @Tmplar
      @Tmplar 2 месяца назад

      But x sqrt(x) grows faster than x log(x)

    • @rodrigoqteixeira
      @rodrigoqteixeira 2 месяца назад

      @@Tmplar Yup, you are right, it's not optimal, but it's still made by me :) (and in place). Btw, bubble sort shown in the video is O(n^2), not O(nlogn)

    • @Tmplar
      @Tmplar 2 месяца назад

      @@rodrigoqteixeira Yeah, I just thought you were going for a new best (which is impossible btw). The absolute best for any sorting algorithm O(n log(n)). I’m not trying to beat you down btw, if you have it on github or something I’d like to check it out

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

    Bogo bogo sort is theoretically the fastest, change my mind.

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

    Pls how can you provide a video on how to learn and master algorithms and data structure to pass interview coding test

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

    I have coded an efficient bubble sort in minecraft. But it's not my content. I couldn't upload it.

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

    Bogosort best sort

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

    Heap sort for the win. Worst case O(log n)

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

      You forgot an n.
      Sorting anything in logarithmic time would imply you can sort two objects by only looking at one.

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

    Bad explonation: what is a value, an object, can it just sort numbers?

  • @tonyhakston536
    @tonyhakston536 2 года назад +8

    Wait…
    Did the Google CEO not know that?

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

      It's part of the 4th amendment that CEO:s get their algorithms from president. God bless Abraham Lincoln for creating the A* pathfinding algorithm

  • @FirstnameLastname-rn6qq
    @FirstnameLastname-rn6qq 2 года назад

    I prefer quick sort

  • @249_shouvikfahim3
    @249_shouvikfahim3 2 года назад

    Isnt it super useful for finding just the highest/lowest values in a huge amount of data? It only has to go through a few iterations then

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

      First if you want to find the highest or lowest value, just go over it once.
      If you want to find the biggest N numbers you could create a max heap.
      A max heap is a binary tree with the condition, that every nodes parent is bigger or equal.
      That way you can gurantee, that the biggest value is on the top without having to completely sort the data.
      If you want to find the second biggest number, you remove the top node and replace it by one of his children.
      By definition, one of those children has to be the biggest new node.
      There even is a sort algorithm called heapsort, which creates a heap and extracts the top element till its empty resulting in sorted data.

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

    I also said this when I was 5.

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

    i mean, i didn't feel like i am five.

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

    What's the best programming language to learn for a beginner? Because I've been thinking of starting for a long time I just don't know how to.

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

      Python should be good. I started with Python and now I can program some decent stuff. Would highly recommend.

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

      @@labscience8271 thanks for the suggestion. What's a good introductory tutorial for python? Because I'm not out of school yet and I want to work on my portfolio ad fast as possible. Cheers!

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

      @@daveeeeeeeeeeeeeeeeeeee
      I started with this tutorial from this legend on FreeCodeCamp:
      ruclips.net/video/rfscVS0vtbw/видео.html
      If you want to create basic GUI stuff, here is my second legendary tutorial: ruclips.net/video/YXPyB4XeYLA/видео.html
      They take +4 or +5 hours. Don't do it all on the same day or you'll forget everything. Also, take notes. Wish you a good start. Good luck!

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

      @@labscience8271 Thanks for everything!

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

      @@daveeeeeeeeeeeeeeeeeeee No problem dude

  • @just-a-bajan6643
    @just-a-bajan6643 2 года назад

    Lol Bubble Sorting..leaned that back in 1987, sheesh they still teach that…?

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

    Isn’t it a Shaker Sort when you change a direction of iteration?

  • @0Fallen0
    @0Fallen0 2 года назад

    Try Bogo Sort 😈

  • @elchavodelocho2055
    @elchavodelocho2055 8 месяцев назад

    Part 2?

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

    Obamium

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

    Wait... I'm not supposed to use bubble sort? Oops

  • @BurhanAijaz
    @BurhanAijaz 2 года назад +5

    me who codes in python,
    .sort()

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

    What about bogosort

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

    Then why not college Remove this topic 🙂

  • @The2011andrey
    @The2011andrey 8 месяцев назад

    does Obama know prpgramming?

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

    Do you know that algorithm made by arabic scientist his name Muhammad ibn Musa *al-Khwarizmi* before more thousand year

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

    Your language is way too high level for ELI5. Its more like ELI12

  • @jamesa.646
    @jamesa.646 2 года назад

    I'm 9 not 5

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

    If you're 5yo, I'm sure you don't know numbers yet. So comparing value won't mean anything to you. 🤣

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

    Bogo sort

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

    so which sort algo is the best ?

  • @torlumnitor8230
    @torlumnitor8230 9 месяцев назад

    What 5 year olds are you talking too?

  • @mentilly_all
    @mentilly_all 8 месяцев назад

    this is not explanation of algorithms