## Buy/Download all MCQ Ebook
>>>**Click Here**<<<

## Data Structure Questions and Answers-Bubble Sort

## Click on any option to know the CORRECT ANSWERS

Question 1 |

What is an external sorting algorithm?

Algorithm that uses tape or disk during the sort | |

Algorithm that uses main memory during the sort | |

Algorithm that involves swapping | |

Algorithm that are considered 'in place' |

**UPSC test Questions answers**

Question 1 Explanation:

As the name suggests, external sorting algorithm uses external memory like tape or disk.

Question 2 |

What is an internal sorting algorithm?

Algorithm that uses tape or disk during the sort | |

Algorithm that uses main memory during the sort | |

Algorithm that involves swapping | |

Algorithm that are considered 'in place' |

**Reasoning Questions answers**

Question 2 Explanation:

As the name suggests, internal sorting algorithm uses internal main memory.

Question 3 |

What is the worst case complexity of bubble sort?

O(nlogn) | |

O(logn) | |

O(n) | |

O(n ^{2}) |

**Biology Questions answers**

Question 3 Explanation:

Bubble sort works by starting from the first element and swapping the elements if required in each iteration.

Question 4 |

Select the appropriate code that performs bubble sort.

for(int j=arr.length-1; j>=0; j--) { for(int k=0; k<j; k++) { if | |

for(int j=arr.length-1; j>=0; j--) { for(int k=0; k<j; k++) { | |

for(int j=arr.length; j>=0; j--) { for(int k=0; k<j; k++) { if(arr[k< | |

None of the mentioned |

**Computer science Questions answers**

Question 4 Explanation:

The outer loop keeps count of number of iterations, and the inner loop checks to see if swapping is necessary.

Question 5 |

What is the average case complexity of bubble sort?

O(nlogn) | |

O(logn) | |

O(n) | |

O(n ^{2}) |

**Management Questions answers**

Question 5 Explanation:

Bubble sort works by starting from the first element and swapping the elements if required in each iteration even in the average case.

There are 5 questions to complete.