Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

tasreeb

  • 3 years ago

plz let me know how to implement of bubble sort algorithm(DATA,N)

  • This Question is Closed
  1. gablu.bhn
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    what is (DATA,N)

  2. tasreeb
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    here DATA is an array with N elements

  3. rsmith6559
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Check out Wikipedia for bubble sort. They'll probably have pseudo code.

  4. tasreeb
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    ok thanks

  5. krithika
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

    1. start 2. for(i=1;i≤n;i++) read a[i]; 3. for(i=n-1;i≥1;i--) for(j=1;j≤i;j++) { if( a[j] > a[j+1] ) { temp=a[j] a[j]=a[j+1] a[j+1] = temp } }

  6. tasreeb
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    thanks dear!

  7. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy