Selection sort in arrays

  1. What are the best case and worst case time complexity of the selection sort? When And All I can use the selection sort compare to other sort?

2.Is it an efficient of way of sorting ? because we run the
Two for loops in your demo video . Please advise is it efficient or not ?

  1. Instead of writing a new code ,Do we have any Inbuilt STL function for this Selection sort ?

  2. Please give some real life example for selection sort and where i can apply this logic’s.

when the input is in the sorted array

when already sorted u can use this
but since worst ccase complexity is quadratic we generally dont go for this sorting

i dont think so
because the standard stl sort function has its own functioning and it gives O ( N logn ) and its probably implementing randomised quick sort

we learn the various kinds of sort so that we get an idea about how some different questions can be done
like there are questions which are updated version of bubble sort

sorting is useful in many many questions when u practice further in the course u`ll realise it urself

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.