[Coursera][Algorithms] helper classes from assignment of week 5