Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Queue<int> Copy_Queue(Queue<int> q)
- {
- Queue<int> qhelp = new Queue<int>();
- Queue<int> qnew = new Queue<int>();
- while (!q.IsEmpty())
- {
- qhelp.Insert(q.Head());
- qnew.Insert(q.Remove());
- }
- while (!qhelp.IsEmpty())
- {
- q.Insert(qhelp.Remove());
- }
- return qnew;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement