#include<iostream>
using namespace std;
struct Node{
int data;
struct Node * next;
struct Node * prev;
};
void insertNodeAtStart(struct Node** head, int value)
{
struct Node *last = (*head)->prev;
struct Node* new_node = new Node;
new_node->data = value;
new_node->next = *head;
new_node->prev = last;
last->next = (*head)->prev = new_node;
*head = new_node;
}
void deleteNodeFromStart(struct Node** head){
struct Node *Ptr = (*head);
struct Node *first =(*head);
if (head == NULL) return;
first = first->next;
first->prev = NULL;
free(Ptr);
head = &first;
}
int main(){
}
Comments
Leave a comment