code for cs 311, data structures and algorithms.