Data structure problem set answer