时间复杂度O(n),空间复杂度O(1)
//删除*p节点,将后继结点赋值p,删除后置结点,等效于删除p
bool del_p(Node* p) {
Node* q = p->next;
p->data = q->data;
p->next = q->next;
free(q
时间复杂度O(n),空间复杂度O(1)
//删除*p节点,将后继结点赋值p,删除后置结点,等效于删除p
bool del_p(Node* p) {
Node* q = p->next;
p->data = q->data;
p->next = q->next;
free(q