Graph program code,hardnut

Hey fellas,

Im workin on a program that reads a list from the table of 2 columns(text format).Iv created an interface that reads the table which is a linked list(the elemenst opposite to each other in thetable are said to have a link) and stores the values in the 2 dimensional arrays.The next step is to

1 )Count the number of times an element has occured on both sides of the table.i.e. how many links it has .any one know how to do that?

2 )Make an internal table that relabels te elements in the desecending order of number of times it has repeated(number of links it has).The element with the most links is labeled 1 and the element with the least number of links is labelled the last.

3 )All the elements linked to eachother are neighbours.If more than 1 element have the same number of links then they are sorted in descending order of their neighbours number of links(checking from the table above),comparing neighbours with the highest number of links,if thats the same then neighbours with 2nd largest number of links,until all neighbours have been compared.Incase the number of links for an element is still the same,the sort order does not matter.

4 )Finally when all the elements have been relabelled,the new labels will be put onto the initial table of links.

5 )The table will then be graphed with elements in the 1st column(x axis) against elements in the 2nd column(y axis).For each link therel be a dot both(x,y) and(y,x) wise.

If anyone can solve all or part of this ,il be thankful.More details can be provided if you dont understand any part.

xo