This blog site is dedicated for articles on problem solving using C, C++, data structures, algorithms. Besides this few technical articles are also presented.
Apr 20, 2011
remove a given node from a list
remove(h, a)
{
if(h == 0 || a== 0)
return ;
if(h == a)
{
a = a->next
delete h
h = a
return
}
t=h
while(t->next)
{
if(t->next == a)
{
k = t->next->next
delete t->next
t->next = k
return
}
No comments:
Post a Comment