snippets about single direction linked list and common graph traversal algorithms