a homework assignment for data structures and algorithms class