Computer Science, asked by shubnegi1004, 5 hours ago

Algorithm to find no. of duplicate nodes in single link list​

Answers

Answered by kshubharajshetty
0

Answer:

Create a new node.

It first checks, whether the head is equal to null which means the list is empty.

If the list is empty, both head and tail will point to a newly added node.

If the list is not empty, the new node will be added to end of the list such that tail's next will point to a newly added node.

Answered by harish749391
0

Explanation:

Input the elements of the linked list in sorted order. Traverse from the head of the sorted linked list. While traversing, compare the current node with the next node. If data of the next node is the same as the current node then delete the next node

Similar questions