Amazon Interview Question
SDE1sCountry: India
Interview Type: In-Person
"and for sorting you can use only swap"
what does above statement mean? if we can sort without swapping then like using insertion sort...i think with both(bubble/selection sort) , we may need more than one swap for a
like
bacabd
also in selection sort,if we can swap with last minimum then i think it can also work...
It is it a random swap or element next to it?
- Anon? January 27, 2014