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;
}
}
}
Comments