Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. template <class T>
  2. QueueList<T>::QueueList(const QueueList<T>& src)
  3. {
  4.     head_ = new Node(src.head_->value_, nullptr, nullptr);
  5.     Node* unit1 = head_;
  6.     Node* unit2 = src.head_;
  7.     while (unit2->next_ != nullptr)
  8.     {
  9.         unit2 = unit2->next_;
  10.         unit1->next_ = new Node(unit2->value_, nullptr, unit1);
  11.         unit1 = unit1->next_;
  12.     }
  13.     tail_ = unit1;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement