An Algorithm for Functional Reconfiguration of Fixed-Size Arrays