java collections sort space complexity