Partition Algorithm Time Complexity