A Recursive Algorithm for Low-Power Memory Partitioning