diff --git a/data_structures/linked_list_delete_without_head.cpp b/data_structures/linked_list_delete_without_head.cpp index a2564ddc9..53b9f288d 100644 --- a/data_structures/linked_list_delete_without_head.cpp +++ b/data_structures/linked_list_delete_without_head.cpp @@ -41,16 +41,16 @@ nodes as 40, 60 and 30. struct Node{ int data; Node *next; - Node(int x){ + explicit Node(int x){ data=x; - next=NULL; + next=nullptr; } } *head; //To search for the given node Node *findNode(Node *head, int search){ Node *cur= head; - while(cur!=NULL){ + while(cur!=nullptr){ if(cur->data==search) break; cur=cur->next; @@ -59,7 +59,7 @@ Node *findNode(Node *head, int search){ //To populate the linked list void insert(){ - int i, n, value; + int i=0, n, value; Node *temp; scanf("%d",&n); for(int i=0; i