Bubble Sort Got Bible

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MyrinNew
    Senior Member
    • Feb 2024
    • 5168

    #1

    Bubble Sort Got Bible

    list = [3,1,2,4,2]


    easiest sort algorithm ever seen






    for i loop list {
    for j loop list - i {
    // i = 0
    // j = 0,1,2,3,4
    // this calculate the max value and push to last
    // eg [1,2,3,2,4]

    // second most
    //i = 1
    // j = 0,1,2,3 // got max value so no use of last index
    // find second most
    // eg [1,2,2,3]
    }
    }









    More...
Working...