public void addToEnd(BirdDataNode newNode) { if (next == null) { next = newNode; } else { next.addToEnd(newNode); } }
public void add(string bird) { var newNode = new BirdDataNode(bird); if (head == null) { head = newNode; } else if (getCount(bird) != 0) // Usage of getCount() here { find(bird).population++; } else { head.addToEnd(newNode); } }