How to use the system defined sort function

how can i sort the elements in it using the sort function under algorithm header file.

c is any container
sort(c.begin(),c.end());

for more details see the Documentation

if it is so then why is the sort function in this program not working and i am using it on a user defined container

please reply fast…

no inbuilt sort work on only inbuilt container

to sort your linked list you have to write your own sort function

although i had just started my journey of coding and in each linked list question i had to make my own containers to do the problem which sometimes is really hectic to write the same functions again and again, so is there any way to avoid it.

and from your experience when we go further in programming doing some tough questions then at how many occation we need to create our own containersand its functions and how many times our work is done by using stl ncointers only.

please reply my query…

when you are practicing on online platforms almost every time you have to use stl

but something in placements or interviews you have to write from scratch

So can this k append problem be solved using stl containers and if yes then how??

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.