Frequently Asked Java Program 22: Sort Elements in Array | Bubble Sort

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ต.ค. 2019
  • Topics :
    -----------
    1)Sort Elements in Array
    2) Bubble Sort
    #########################
    Udemy Courses:
    #########################
    Manual Testing+Agile with Jira Tool
    ************************************
    ► shorturl.at/xNXZ4
    Selenium with Java+Cucumber
    ********************************
    ► shorturl.at/aIKMW
    Selenium with Python & PyTest
    ********************************
    ► shorturl.at/ELW09
    Selenium with python using Robot framework
    ****************************************
    ► shorturl.at/bcDPZ
    API Testing(Postman, RestAssured & SoapUI)
    *****************************************
    ► shorturl.at/uAWY7
    Web & API Automation using Cypress with Javascript
    ********************************************
    ► rb.gy/4uum2n
    Playwright with Javascript
    **************************
    ► shorturl.at/gALZ1
    Jmeter-Performance Testing
    ************************
    ► rb.gy/ocj7r2
    SDET Essencials(Full Stack QA)
    *************************
    ► rb.gy/hlnf2v
    Appium-Mobile Automation Testing
    ************************************
    ► rb.gy/wmzv64
    Java Collections
    *****************
    ► bit.ly/3S66ezE
    Python Programming
    *********************
    ► urlis.net/gdsfpb0s
    Cucumber BDD Framework
    ***************************
    ► bit.ly/3F7d69r
    Protractor with Javascript
    ***************************
    ► urlis.net/4uddm1qb
    ####################################
    TH-cam Playlists:
    ####################################
    Manual Testing & Agile
    ***********************
    ► bit.ly/3ujvaYa
    ► bit.ly/3OYzxQj
    SQL
    *************************
    ► bit.ly/3R6XjeG
    ► bit.ly/3nE0a1s
    ► bit.ly/3IeKuuJ
    linux & Shell Scripting
    **********************
    ► bit.ly/3up1Z6a
    ► bit.ly/3nzvGxx
    Java
    **********************
    ► bit.ly/3R9QfOs
    ► bit.ly/3AoRMKM
    ► bit.ly/3IbTTDn
    ► bit.ly/3ybXInv
    ► bit.ly/3yCoHdw
    Selenium With Java+Cucumber
    ********************************
    ► bit.ly/3P2FMm4
    ► bit.ly/3yhiIt4
    ► bit.ly/3uokzet
    ► bit.ly/3a7XIND
    ► bit.ly/3umN2S9
    ► bit.ly/3aar7GW
    ► bit.ly/3y9kD2S
    ► bit.ly/3uhLskn
    Python
    ********************************
    ► bit.ly/3agNgU0
    ► bit.ly/3NJNnoy
    ► bit.ly/2CTQ4mR
    ► bit.ly/3OIYWh1
    Selenium With Python,Pytest&Behave
    ***************************************
    ► bit.ly/3OHHoC9
    ► bit.ly/3IeNLdv
    ► bit.ly/2J4tPeT
    ► bit.ly/3ydSkAq
    Selenium With Python Using Robert Framework
    (Web&API Testing)
    *************************************************
    ► bit.ly/3nUvlpr
    ► bit.ly/3nUvE3z
    API Testing (Postman,SoapUi,&Rest Assured)
    **********************************************
    ► bit.ly/3OXacWY
    ► bit.ly/3yh0UhE
    ► bit.ly/3nC9DWQ
    ► bit.ly/3yGfhNS
    ► bit.ly/3OJa11H
    ► bit.ly/3P2slCC
    Mobile App Testing Appium
    ****************************
    ► bit.ly/3Al49HG
    Performance Testing Jmeter
    *******************************
    ► bit.ly/3nz4fE7
    Maven,Jenkins,Git,Github,CI/CD
    *******************************
    ► bit.ly/3P16HPj
    ► bit.ly/3yhlUVA
    ► bit.ly/3afYfwT
    ► bit.ly/3yGzweG
    ► bit.ly/3yF73Ws
    ► bit.ly/3NCOmH7
    SQL,DB Testing&ETL,Bigdata
    *******************************
    ► bit.ly/3NKOcNY
    ► bit.ly/3OVpDyI
    ► bit.ly/3NEvUy0
    ► bit.ly/3IryxlT
    ► bit.ly/3RkWBLh
    JavaScript Based Automation Tools
    ********************************
    ► bit.ly/3nUx51X
    ► bit.ly/3AqI6Q0
    ► bit.ly/3yeurbT
    ► bit.ly/3ujzpTK
    Selector Hub Tools
    ********************
    ►rb.gy/h3h424
    GraphQL
    ******************
    ► rb.gy/sj3gys
    Cypress API Testing
    ********************
    ► shorturl.at/fjKPX
    Cypress Web Testing
    **********************
    ► shorturl.at/agjlK
    Playwright with Javascipt
    **************************
    ► shorturl.at/adSTY
    #PythonSorting
    #ArraySorting
    #SortElements
    #AlgorithmsInPython
    #CodeSorting
    #PythonArrays
    #ArrayManipulation
    #SortAlgorithm
    #CodingInPython
    #DataStructures
    #PythonProgramming
    #ArrayOperations
    #AlgorithmTips
    #SortingTips
    #TechProgramming
    #PythonTips
    #CodeOptimization
    #ProgrammingSkills
    #ArrayManagement
    #SortLogic
    #PythonDevelopers
    #AlgorithmDesign
    #CodingCommunity
    #PythonLearning
    #ArrayTricks
    #SortFunctions
    #ProgrammingHelp
    #PythonArrays101
    #CodingJourney
    #SortChallenges
    #ProgrammingLanguages
    #PythonSnippets
    #ArrayPuzzles
    #SortVisualizations
    #CodeDebugging
    #PythonTipsAndTricks
    #AlgorithmMastery
    #CodingSolutions
    #PythonTricks
    #ArrayProblems
    #SortTechniques
    #CodeMentorship
    #PythonCommunity
    #AlgorithmExplained
    #CodingInspiration
    #ArrayExamples
    #SortWalkthrough
    #CodeExploration
    #PythonExperts
    #AlgorithmDiscussion

ความคิดเห็น • 42

  • @charanbudama2601
    @charanbudama2601 3 ปีที่แล้ว +19

    Excellent! no one explained the bubble sort so easily !

    • @sdetpavan
      @sdetpavan  ปีที่แล้ว +2

      Thanks

    • @suman8528
      @suman8528 ปีที่แล้ว

      @@sdetpavan
      Can you please make more dsa videos

  • @Gyan2D
    @Gyan2D 7 หลายเดือนก่อน

    This video is so easy to understand, I have watched once & run the program…Thanks!

  • @y.prakashrao511
    @y.prakashrao511 ปีที่แล้ว

    hii sir please can you tell why this looping is not working for list array

  • @ankitchavan6492
    @ankitchavan6492 2 ปีที่แล้ว

    sir, what if we avoid sorted element in inner forLoop ?

  • @reshmak6459
    @reshmak6459 10 หลายเดือนก่อน +2

    Can you do same for insertion and selection sort also..It will be helpful sir

  • @user-jc7ts2ou4j
    @user-jc7ts2ou4j 10 หลายเดือนก่อน +1

    Excellent! way of explanation! Thanks!

    • @sdetpavan
      @sdetpavan  10 หลายเดือนก่อน

      You're welcome!

  • @akshitajha7029
    @akshitajha7029 ปีที่แล้ว

    Thank you so much sir, sir please make video on quick sort , selection sort,

  • @tejashwinikudari3309
    @tejashwinikudari3309 ปีที่แล้ว

    Sir u told that, if u give i=1 than i

  • @rams9014
    @rams9014 4 ปีที่แล้ว

    Hi, can you please add video showing how to merge two arrays

  • @nikhilbhangale5894
    @nikhilbhangale5894 ปีที่แล้ว +2

    you are a great teacher please keep it up.....best luck.

  • @anushreepan7993
    @anushreepan7993 2 ปีที่แล้ว +3

    Thanks for this easy explanation....I am glad... 😀

    • @sdetpavan
      @sdetpavan  ปีที่แล้ว

      You are welcome

  • @madhavikore5831
    @madhavikore5831 ปีที่แล้ว

    sir i have got a index out of bond exception

  • @mohamediqbala5013
    @mohamediqbala5013 4 ปีที่แล้ว +2

    Thank You very much Sir.

  • @arjumanbanu7364
    @arjumanbanu7364 4 ปีที่แล้ว

    It helpful soo much... Thanx sir

  • @vishalcoder4964
    @vishalcoder4964 2 ปีที่แล้ว +3

    There can be an optimisation to this - What if all the elements of the array are aldready sorted? In this case still the current algorithm will run for O(N^2) which we dont need. Instead, we can have a boolean check inside the swap method. If there is no time the boolean gets flipped, we are sure that the array is aldready sorted.

    • @Rishabh-yr6kg
      @Rishabh-yr6kg 3 หลายเดือนก่อน

      jo mil rha lelo gyan mat do smjhe

  • @ayush_agarwal42
    @ayush_agarwal42 ปีที่แล้ว +2

    Sir in j loop we should run it from 0 to n-i-1 because after every pass 1 element is getting sorted at the end and which is stored in i thats why.

    • @vinaylofi3105
      @vinaylofi3105 หลายเดือนก่อน

      True, but no change in output speed of execution increases

  • @2anshumansehgal
    @2anshumansehgal 4 ปีที่แล้ว +1

    Thanks so much sir!

  • @luckydev2293
    @luckydev2293 4 ปีที่แล้ว +1

    Thank you sir🤝

  • @ashubtech9911
    @ashubtech9911 3 ปีที่แล้ว

    What is the process for sorting strings in an array.?

    • @swamy-rx1pn
      @swamy-rx1pn ปีที่แล้ว

      Dim array1()
      xp = "HEADC"
      strlen = len(xp)

      For Iterator = 1 To strlen
      a = mid(xp,Iterator,1)
      ReDim preserve array1(Iterator)
      array1(Iterator) = a
      Next

      p=1
      num = array1
      leng = Ubound(num)
      for i = 1 to leng
      for j = 1 to leng
      if num(i) < num(j) then
      temp = num(i)
      num(i) = num(j)
      num(j) = temp
      end if
      next
      next
      mp = num2
      For i = 1 to leng
      str = str & num(i)
      next
      msgbox str

  • @mukeshbalaji2983
    @mukeshbalaji2983 10 หลายเดือนก่อน

    “Earth rotates on its axis as it revolves around the Sun.”
    Earth -> Loop
    Sun -> Array
    rotates on its axis -> inner loop (j loop)
    revolves around the Sun -> outer loop (i loop)

  • @Harishkumar-ne1vn
    @Harishkumar-ne1vn 3 ปีที่แล้ว +2

    very helpfull and good teaching sir!!!! u will sure hit 1m subscribers soon and u desrve it

  • @swayamprakashbhuyan2580
    @swayamprakashbhuyan2580 2 ปีที่แล้ว +1

    Commenting for better reach

  • @SandeepAdi1317
    @SandeepAdi1317 ปีที่แล้ว

    super superb superb 😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇😇

  • @rajeswarir2964
    @rajeswarir2964 ปีที่แล้ว

    Thank u sir ☺️☺️

  • @dheerajkurugod
    @dheerajkurugod 3 ปีที่แล้ว

    Super teacher

    • @sdetpavan
      @sdetpavan  3 ปีที่แล้ว

      Thank you! 😃

  • @naveenkumarpangati2433
    @naveenkumarpangati2433 4 ปีที่แล้ว

    Sir I want this program dynamically

    • @TechStack9
      @TechStack9 3 ปีที่แล้ว +4

      Do you want to read the elements dynamically, if so, below is the code for that:
      Scanner s = new Scanner(System.in);

      System.out.print("Enter number of elements:");
      int n = s.nextInt();
      int a[] = new int[n];

      for(int i=0; i