Added C version of list_traversal