Data structure and algorithm sample code