C++ List sort()C++ List sort() function arranges the elements of a given list in an increasing order. It does not involve in any construction and destruction of elements. Elements are only moved within the container. SyntaxParameterIt does not contain any parameter. Return valueIt does not return any value. Example 1Let's see a simple example Output: Elements of list are : 6,4,10,2,4,1, Sorted elements are : 1,2,4,4,6,10 In this example, sort() function sorts the elements of a given list and its output is 1,2,4,4,6,10. Example 2Let's see a simple example Output: javaTpoint Taaijnoptv In this example, sort() function sorts the character values on the basis of their ascii values. Next Topicmerge() Function |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India