Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
reverse a stack
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { { { } //Reverse a stack public static class ReverseStack { //This method returns a stack public static Stack Reverse(Stack input) { //Declare another stack to store the values from the passed stack Stack temp = new Stack(); //While the passed stack isn't empty, pop elements from the passed stack onto the temp stack while (input.Count != 0) temp.Push(input.Pop()); return temp; } } } } } }
run
|
edit
|
history
|
help
0
Problem: rstring
IntNull
Simple Constructor Implementation
DijkstraAlgo
Switch on String
wwee
Herencias
Generic class and method example in C#
Interface
LINQ-Group BY