The Gateway to Computer Science Excellence
0 votes
455 views

in Programming by Loyal (7.2k points)
edited by | 455 views
0

Question taken from official website. Link : http://cds.iisc.ac.in/wp-content/uploads/model_question.pdf 

0
I am trying...

while(current->next!=NULL && current->value<deleteValue)
{
previous=current;  
current=current->next;
}

if(current->value==deleteValue)
{
if(previous==NULL)  //If the deleteValue is the first node
head=current->next;  //Change the head

else
{
previous->next=current->next; 
}

if(current->next!=NULL) //If the node to be deleted is not the last node
current->next->prev=previous;
}

 

However I couldn't find enough blank to free the node.

 

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,647 questions
56,492 answers
195,439 comments
100,706 users