template<class type>
Chain<type> LinearList<type>::Convert()
{
Chain<type> x;
ChainNode<type> *prev, *y;
x.first = new ChainNode<type>;
prev = x.first;
for (int i = 0; i < length; i++) {
   y = new ChainNode<type>;
   y->data = element[i];
   prev->link = y; prev = y;
   }
prev->link = x.first;
ChainNode<type> *q;
for (q=x.first->link; q != x.first; q = q->link) cout << q->data;
cout << endl;
return x;
}
