Data structure and algorithm problem solutions