 Welcome back, in the last segment we talked about vectors. In this segment we are going to talk about sorting. So first how to sort a vector. So C++ provides a built-in facility to sort vectors and also arrays and for this you need to include the header file algorithm. So once you do that, suppose you have a vector v of 10 elements. Suppose somehow you put values into this vector. Then you have to sort, if you want to sort, you just do this. You write sort v dot begin, v dot end, that is it. So I have not told you what v dot begin and v dot end are. Think of these right now as mantras but I am going to tell you what they mean shortly. So this will sort v in non-decreasing order and begin and end are what are called iterators. So iterators are kind of pointers but they are abstract pointers and we are going to discuss them later. Sorting an array is quite similar but not entirely. So again we need the header file algorithm. So suppose we have an array of 100 elements and somehow we initialized it, put values into it and if I want to sort it, I just have to write sort a and a plus 100 or here whatever the length it should appear over here, that is it, then it is sorted. The sorting order can be decided, you do not have to always sort in non-decreasing order. And in fact you can sort anything on which the less than operator is defined. So for example you can sort strings. You can also create objects or create structs in which you write the less than operator. Once you write the less than operator, you are ready to sort it. So this means for example I might have a struct which stores marks of various students and I can now choose to sort those structs, say either by the physics marks or by the chemistry marks or whatever I want, maybe by the total marks. I just have to define the less than operator consistent with the order that I want. And you do not even have to define the less than operator. In the sorting command itself, you can specify the sorting order by giving a lambda expression. I am not going to talk about this in this lecture but it is discussed quite extensively in the book and it is not hard and I will definitely encourage you to read it because there will be some exercises related to it. So what have we discussed in this segment? So standard library contains algorithms to sort vectors and arrays. For this you need to include the header file algorithm and it can sort any type of objects provided less than operator is defined on those objects or you supply a comparison operation as a part of the call. This concludes this segment and in the next segment I am going to discuss the classes map and unordered map but let us take a quick break before that.