There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. C.A.R. Hoare

Counts the number of repeat elements

Language Java | Level Intermediate | Category Data structure | September 5, 2015 10:19 pm

Data structure Description

Write program to count the repeated items from the singly linked list.

Example, 12->34->56->12->67->34-NULL
Output { 12=2, 34=2,56=1,67=1}



Print the list of items: 21->52->33->21->67->33->21->NULL
Linked list items with count :{ 21=3, 52=1, 33=2, 67=1}



No comments available!

Please login to add comments.