Add sort methods for arrays and pointer arrays