Розмір відео: 1280 X 720853 X 480640 X 360
Показувати елементи керування програвачем
Автоматичне відтворення
Автоповтор
class Solution { public: Node* deleteNode(Node* head, int x) { Node* temp = head; if(x==1){ temp->next->prev = NULL; return temp->next; } int cnt =1; while(cntnext; } if(temp->next==NULL){ temp->prev->next=NULL; } else{ temp->next->prev= temp->prev; temp->prev->next = temp->next; } return head; }};
class Solution {
public:
Node* deleteNode(Node* head, int x) {
Node* temp = head;
if(x==1){
temp->next->prev = NULL;
return temp->next;
}
int cnt =1;
while(cntnext;
}
if(temp->next==NULL){
temp->prev->next=NULL;
}
else{
temp->next->prev= temp->prev;
temp->prev->next = temp->next;
}
return head;
}
};