Someone
public text v1 · immutablestatic Stack<int> order(Stack<int> s)
{
Stack<int> s1 = new Stack<int>();
Stack<int> s2 = new Stack<int>();
int temp, temp1;
while (!s.IsEmpty())
{
temp = s.Pop();
while (!s.IsEmpty())
{
temp1 = s.Pop();
if (temp > temp1)
{
s1.Push(temp);
temp = temp1;
}
else
s1.Push(temp1);
}
s2.Push(temp);
while (!s1.IsEmpty())
s.Push(s1.Pop());
}
return s2;
}