Write programs for Bubble Sort, Quick sort

Answer Posted / ganga

all the above programs are wrong!!!

heres a perfect one.. simple logic!

for(i=0;i<n-1;i++)
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
}
// now print the elements n see

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of using arrays?

511


What is the difference between Array and LinkedList?

567


What is bubble sort with example?

504


Which is the simplest file structure?

551


What are the advantages and disadvantages of copyonwritearraylist?

637






Describe the types of data structures?

577


What is dynamic data structure?

721


Write a recursive c function to calculate the height of a binary tree.

505


What is the difference between hashset and linkedhashset?

513


What is the difference between for and foreach loop?

461


What is data structure explain different types of data structures with examples?

511


In depth questions regarding the data structures and the Databases used in the Projects developed.

554


Which are the sorted collections?

560


Can a stack be described as a pointer? Explain.

459


Why is data structure needed?

536