How do you do a selection sort?



How do you do a selection sort?..

Answer / Avantika Singh

Selection Sort is a simple sorting algorithm that works by repeatedly finding the minimum element from the unsorted part of the array and putting it at the beginning of the sorted part. Here's a basic pseudocode:
1. For each position i in the array, starting with i=0:
a. Find the smallest value among arr[i..end of array]
b. Swap arr[i] and the smallest found value

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

Mention a few applications of linked lists?

1 Answers  


Why do we use hashmap?

1 Answers  


What’s the difference between enumeration and iterator interfaces?

1 Answers  


Differentiate stack from array?

1 Answers  


What is entryset in hashmap?

1 Answers  


Is any implicit arguments are passed to a function when it is called?

1 Answers  


What is the difference between hashset and linkedhashset?

1 Answers  


How can avl tree be useful in all the operations as compared to binary search tree?

1 Answers  


Is hashset synchronized?

1 Answers  


What package is arraylist?

1 Answers  


How to use appendNode() in linkedlist()?

1 Answers  


What is the difference between hashset and treeset?

1 Answers  


Categories