java - Searching a linklist -
hello have project have read in file of voters name, age , party. list 100 names in length. search through file counting party's , returning winning party. ideas.this have far.
public searchlist search(string party){ searchlist link = firstlink; if(!isempty()){ while(link.party != party){ for(int = 0; i<party.length(); i++) { if (party.equals(party.get(i).getparty())) return party.get(i).tostring(); } return null; } } return null; }
Comments
Post a Comment