## Help authour, Buy PDF Ebook
>>>**Click Here**<<<

## Data Structure Questions and Answers-Selection Sort

Question 1 |

What is an in-place sorting algorithm?

It needs O(1) or O(logn) memory to create auxiliary locations | |

The input is already sorted and in-place | |

It requires additional storage | |

None of the mentioned |

**Geography Questions answers**

Question 1 Explanation:

Auxiliary memory is required for storing the data temporarily.

Question 2 |

In the following scenarios, when will you use selection sort?

The input is already sorted | |

A large file has to be sorted | |

Large values need to be sorted with small keys | |

Small values need to be sorted with large keys |

**ICT Questions answers**

Question 2 Explanation:

Selection is based on keys, hence a file with large values and small keys can be efficiently sorted with selection sort.

Question 3 |

What is the worst case complexity of selection sort?

O(nlogn) | |

O(logn) | |

O(n) | |

O(n ^{2}) |

**Education Questions answers**

Question 3 Explanation:

Selection sort creates a sub-list, LHS of the 'min' element is already sorted and RHS is yet to be sorted. Starting with the first element the 'min' element moves towards the final element.

Question 4 |

Select the appropriate code that performs selection sort.

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

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

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

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

**Computer science Questions answers**

Question 4 Explanation:

Starting with the first element as 'min' element, selection sort loops through the list to select the least element which is then swapped with the 'min' element.

Question 5 |

What is the advantage of selection sort over other sorting techniques?

It requires no additional storage space | |

It is scalable | |

It works best for inputs which are already sorted | |

It is faster than any other sorting technique |

**Reasoning Questions answers**

Question 5 Explanation:

Since selection sort is an in-place sorting algorithm, it does not require additional storage.

There are 5 questions to complete.