What is a bubble sort and how do you perform it?



What is a bubble sort and how do you perform it?..

Answer / Shivalok Mishra

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.
1. Start from the beginning of the list.
2. Compare each pair of adjacent items and swap them if they are in the wrong order.
3. Repeat the process for the entire list until no more swaps are needed, indicating the list is sorted.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What are the goals of data structure?

1 Answers  


How would you implement two stacks using a single array?

1 Answers   TCS,


Define balancing condition for AVL Tree.

1 Answers  


How can we reverse the order in the treemap?

1 Answers  


What are the advantages and disadvantages of copyonwritearraylist?

1 Answers  


What is circular queue example?

1 Answers  


Write the advantage of separate chaining?

1 Answers  


What are the types of Collision Resolution Techniques and the methods used in each of the type?

1 Answers  


Write a Program for Insert in a sorted list

1 Answers  


Are sets sorted?

1 Answers  


What is the advantage of the heap over a stack?

1 Answers  


Does concurrenthashmap allow null?

1 Answers  


Categories