Advertisement
Neveles

Untitled

Mar 29th, 2020
196
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.   Node* ptr = head_;
  8.   while (ptr != nullptr)
  9.   {
  10.     unit2 = unit2->next_;
  11.     unit1->next_ = new Node(unit2->value_, nullptr, unit1);
  12.     unit1 = unit1->next_;
  13.   }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement