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 is minimum depth of binary tree?

495


Define depth and height of a tree?

558


What is shell sort in data structure?

473


Write an algorithm for inserting and deleting an element from doubly linked list?

496


Can you please explain the difference between string and an array?

513






Is quicksort faster than merge sort?

481


What happens if an array goes out-of-bounds?

660


Which is the fastest sorting?

617


Why we need cursor implementation of linked lists?

568


Difference between calloc and malloc ?

527


What is meant by int?

521


Why is merge sort faster?

489


What are types of Collision Resolution Techniques and the methods used in each of the types?

637


Differentiate between iterator and enumeration.

515


What is non linear data structure with example?

502