函数f31()的功能是:在一个按关键字递增有序、头指针为head的带头结点的单链表L中插入一个新结点,并保持链表L的有序性。请在

函数f31()的功能是:在一个按关键字递增有序、头指针为head的带头结点的单链表L中插入一个新结点,并保持链表L的有序性。请在空白处填写适当的语句使函数完整正确。
typedef int KeyType;
typedef struct node{
KeyType key;
struct node *next;
}NODE;
typedef NODE *LinkList;
void f31(LinkList head,KeyType num)
{LinkList p;
p=(LinkList)malloc(sizeof(NODE));
p-> key=num;
while(head-> next!=___(1)___&&head-> next-> key<num)
head=___(2)___;
p-> next=___(3)___;
head-> next=p;
}
【正确答案】:(1)NULL
(2)head-> next
(3)head-> next