Algorithm for Search an Element in Single Linked List

by Dinesh 2013-12-24 19:04:14

Algorithm for Search an Element in Single Linked List

Answers:- Let x be the element to search
void SEARCH(x)
Begin
found=0
current=head
while (current !=null)
{
if(current ->info=x
{
found=1
break
}
current=current->next
}
if(found=1)
print ”Element found”
else
print “Not found"
End.
674
like
0
dislike
0
mail
flag

You must LOGIN to add comments