This program sorts the numbers in a string array by using a bitset provided the numbers are unique. The program keeps track of which numbers have been seen by setting bits in a bitset. The output is printed by visiting all the elements in the bit set. The output should be like this: In sorted order: 2 9 10 21 43 45 52 66 68 71 87 This is the problem. I am not able to give the upper limit while accessing the elements in the bitset. I have given an arbitrary number 100 for now and the program is working. Is there any way to access the last element in the bitset.