Algorithm to find no. of duplicate nodes in single link list
Answers
Answered by
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
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
Math,
3 hours ago
English,
3 hours ago
English,
3 hours ago
English,
5 hours ago
Math,
7 months ago
Social Sciences,
7 months ago
Computer Science,
7 months ago