update time complexity