Input – A file containing at most n positive integers, each less than n, where n=10^7. All integers are unique.
Output – A sorted list in ascending order.
Implementation sketch : A bitmap vector can be used here. For instance, we can store the set {1,2,3,5,8,13} in this bit array [0,1,1,1,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0]
Read full article from Programming Pearls 1.2 | techpuzzl
No comments:
Post a Comment