alogrithms question for uni