(this doubt is not related to the video)
List is like vector ans set combined?
Does the list sort all the elements and then add them.
And if its a List<list> L then if 2 similar lists being added to L then it acts like a set for example if 1,3,2 is added in L and then 1,2,3 is added in L then the list L should contain only 1,2,3?
( I know I couldnt explain the question properly, so please revert and I’ll try rephrasing the question )
Thank you
List vs Vector vs Set
list in stl is a doubly linked list it does’nt sort the value added in the list
list<list > then it is a list of list
A set is ordered. It is guaranteed to remain in a specific ordering, according to a functor that you provide. No matter what elements you add or remove (unless you add a duplicate, which is not allowed in a set ), it will always be ordered.
A vector has exactly and only the ordering you explicitly give it. Items in a vector are where you put them. If you put them in out of order, then they’re out of order; you now need to sort the container to put them back in order.
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.