Exemplo n.º 1
0
sequence::sequence(const sequence& seq){
  capacity=seq.capacity;
  used=seq.used;
  data=new int[capacity];
  seq.shift(data);
  missing=new int[capacity];
  for (size_t i = 0; i < capacity; i++)
    missing[i]=0;
  numMissing=0;
}
Exemplo n.º 2
0
bool sequence::operator==(const sequence& seq){
  if(capacity!=seq.capacity) return false;
  if(used!=seq.used) return false;
  int* temp1=new int[capacity];
  shift(temp1);
  int* temp2=new int[capacity];
  seq.shift(temp2);
  for (size_t i = 0; i < used; i++) {
    if(temp1[i]!=temp2[i]) return false;
  }
  return true;
}