Skip to content

Instantly share code, notes, and snippets.

@cihanyakar
Created November 17, 2016 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cihanyakar/541b0cf05c9161c52b91aa4c2e024b8a to your computer and use it in GitHub Desktop.
Save cihanyakar/541b0cf05c9161c52b91aa4c2e024b8a to your computer and use it in GitHub Desktop.
Yılmaz
Queue<string> TersCevir(Queue<string> kuyruk)
{
var stack = new Stack<string>();
while (kuyruk.Count > 0)
{
stack.Push(kuyruk.Dequeue());
}
var queue = new Queue<string>();
while (stack.Count > 0) {
queue.Enqueue(stack.Pop());
}
return queue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment