ordered an ordered set is similar to an unordered set in the sense that its members are distinctbut an ordered set enforces some predefined comparison on each of its members to produce set whose members are ordered appropriately in dsa and earlier we used binary search tree (defined in ss as the internal backing data structure for our ordered set from versions onwards we replaced the binary search tree with an avl tree primarily because avl is balanced the ordered set has its order realised by performing an inorder traversal upon its backing tree data structure which yields the correct ordered sequence of set members because an ordered set in dsa is simply wrapper for an avl tree that additionally ensures that the tree contains unique items you should read ss to learn more about the run time complexities associated with its operations summary sets provide way of having collection of unique objectseither ordered or unordered when implementing set (either ordered or unorderedit is key to select the correct backing data structure as we discussed in ss because we check first if the item is already contained within the set before adding it we need this check to be as quick as possible for unordered sets we can rely on the use of hash table and use the key of an item to determine whether or not it is already contained within the set using hash table this check results in near constant run time complexity ordered sets cost little more for this checkhowever the logarithmic growth that we incur by using binary search tree as its backing data structure is acceptable another key property of sets implemented using the approach we describe is that both have favourably fast look-up times just like the check before insertionfor hash table this run time complexity should be near constant ordered sets as described in perform binary chop at each stage when searching for the existence of an item yielding logarithmic run time we can use sets to facilitate many algorithms that would otherwise be little less clear in their implementation for example in ss we use an unordered set to assist in the construction of an algorithm that determines the number of repeated words within string