
please wait
|
|
Search()
function is wrong too. You're setting flag=false
if any node in the list doesn't match. I think you'll find that if one node mathes and one node doesn't then it prints the matching node followed by "no record found." To fix this, break out of the loop when you find the matching record. Then after the loop, just check if temp==NULL. If it does then you didnt' find the record.