Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace DemoQueue4
- {
- class SpecialQueue<ELEMENT> : System.Collections.Generic.Queue<ELEMENT>
- {
- public SpecialQueue<ELEMENT> join(Queue<ELEMENT> other)
- {
- SpecialQueue<ELEMENT> result = new SpecialQueue<ELEMENT>();
- ELEMENT[] data = this.ToArray();
- foreach (ELEMENT e in data)
- {
- result.Enqueue(e);
- }
- data = other.ToArray();
- foreach (ELEMENT e in data)
- {
- result.Enqueue(e);
- }
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement