next up previous contents
Next: Sorting a Polynomial With Up: Finding Addresses: Previous: Find the Address of

Find the Address of the Element After:

    // ************************************ //
    // find address after a given element   //
    // ************************************ //
FLOAT_POLY_CELL* FLOAT_POLY::get_after_element_address(unsigned int p) 
{
  FLOAT_POLY_CELL *temp;
  if(!(head==NULL)){
    temp = head;
    if(p==temp->power){
      return(temp->next);
      }
    temp = temp->next;
    while(!(temp==NULL)){
      if(p==temp->power){
        return(temp->next); 
        }     
      temp = temp->next;
      }
    }
  //cout << "The power " << p << " is not in the polynomial."
  //     << endl;
  return(NULL);
}



Jim Peterson
1999-04-22