From d0e1f715f63537bfd57d58fa578f414d457944c2 Mon Sep 17 00:00:00 2001 From: Rakshaa Viswanathan <46165429+rakshaa2000@users.noreply.github.com> Date: Tue, 1 Sep 2020 11:03:56 +0530 Subject: [PATCH] fixed bugs --- data_structures/linked_list_delete_without_head.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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