当前位置: 代码迷 >> 综合 >> 倒着打印单链表
  详细解决方案

倒着打印单链表

热度:75   发布时间:2024-02-09 09:42:54.0
/* 16:倒着打印单链表 */
void Reverse_print_linked_list(single_list_node* head)
{single_list_node* p = head;stack* st = createStack();while(p != NULL){push(st, p->data );p = p->next;}while(!StackIsEmpty(st)){printf("%d	",GetTop(st));pop(st);}printf("\n");}

 

  相关解决方案