Addition of Reallocate algorithm. This algorithm Reallocates space in a stack of size M with N substacks.