Journal of discrete algorithms