What is bubble sort algorithm?
Submitted by: AdministratorBubble sort algorithm is used for sorting a list. It makes use of a temporary variable for swapping. It compares two numbers at a time and swaps them if they are in wrong order. This process is repeated until no swapping is needed. The algorithm is very inefficient if the list is long.
E.g. List: - 7 4 5 3
1. 7 and 4 are compared
2. Since 4 < 7, 4 is stored in a temporary variable.
3. the content of 7 is now stored in the variable which was holding 4
4. Now, the content of temporary variable and the variable previously holding 7 are swapped.
Submitted by: Administrator
E.g. List: - 7 4 5 3
1. 7 and 4 are compared
2. Since 4 < 7, 4 is stored in a temporary variable.
3. the content of 7 is now stored in the variable which was holding 4
4. Now, the content of temporary variable and the variable previously holding 7 are swapped.
Submitted by: Administrator
Read Online Sort And Searching Job Interview Questions And Answers
Top Sort And Searching Questions
☺ | Tell me are there implementations for sorting and searching in the Java libarary? |
☺ | What is Bitonic search? |
☺ | What is bubble sort algorithm? |
☺ | What is Quicksort? |
☺ | Explain exception filter? |
Top Data Structure Categories
☺ | Data Center Manager Interview Questions. |
☺ | Sort And Searching Interview Questions. |
☺ | Creative UI/UX Designers Interview Questions. |
☺ | Data Structure Linked list Interview Questions. |
☺ | Data Structure Arrays Interview Questions. |