What is bubble sort algorithm?



What is bubble sort algorithm?..

Answer / Trapti Gupta

Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted. Here's some pseudocode:

1. Start from the first element of the list (except for the last one)
2. Compare the current element with the next one. If it is greater, swap them.
3. Move to the next pair of elements and repeat the process until you reach the end of the list.
4. Repeat the entire process from step 1, but now if there are no more swaps in a pass, the list is sorted.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What is significance of ” * ” ?

1 Answers  


Describe binary tree and its property.

1 Answers  


Which are the sorted collections?

1 Answers  


Why is quicksort better than mergesort?

1 Answers  


What is data structure definition?

1 Answers  


What is java priority queue?

1 Answers  


How many sorting algorithms are there?

1 Answers  


What is binary tree? Explain its uses.

1 Answers  


What is the average number of comparisons needed in a sequential search to determine the position of an element in an array of 100 elements, if the elements are ordered from largest to smallest?

19 Answers   ABB, SDE,


What is the difference between b tree and binary search tree?

1 Answers  


Explain the implementation of an AVL tree and Binary tree.

1 Answers   Ittiam Systems,


What is a multidimensional array?

1 Answers  


Categories