ordered set time complexity c