Array partitioning functions