Guys i just wanted to know whether set store elements in specific order or it contains unordered elements only. As per c++ specification
Sets are containers that store unique elements following a specific order.
As per my knowledge they are not ordered in the sense that you can't enforce an arbitrary order by placing an arbitrary element in an arbitrary position. it is usually implemented as a red-black tree and i believe due to this it is not possible to place and arbitrary element in an arbitrary position. In java the Set interface does not provide any ordering guarantees.