单选题 下面的算法实现的是带附加头结点的单链表数据结点逆序连接,空缺处应当填入( )。 void reverse(pointer h) { //h为附加头结点指针 pointer p,q; p=h一>next;h一>next=NULL; while(p|=null) { q=p; p=p一>next; q一>next=h一>next; h一>next=(_____); } }
【正确答案】 C
【答案解析】解析:h一>next=q;表示将当前结点作为头结点后的第一元素结点插入。