Write the programs for Linked List (Insertion and Deletion)
operations

Answer Posted / bhargav

In Answer 1 i think there is error in dellast()

void dellast()
{
node *temp,*cur=head;
while(cur->next->next!=NULL) -------> error
{
cur=cur->next;
}
temp=cur->next;
cur->next=NULL;
printf("Deleted item is %d\n",temp->item);
free(temp);
}

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of binary search over linear search?

630


How to sort 1 million floating point numbers?

682


Why is waste sorting important?

567


How do I sort hashset?

497


What is meant by deque?

502






Describe linear probing with an example.

606


Which is faster hashmap or hashtable?

518


What are the types of binary tree?

501


What is the method to find the complexity of an algorithm?

546


What are stacks? Give some of its applications.

555


Define path in a graph?

521


What is a multidimensional array?

536


What do you mean by overflow and underflow?

546


What is static array?

465


What will be the output of below code?

607