从后向前打印链表
链表不能随机访问,要从后向前打印,就先需要找到最后一个节点。
boid print_list(ListNode* head) { if(head != nullptr) { print_list(head->next); print(" "); } }