<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FData_Structure%2FStack</id>
		<title>Csharp/CSharp Tutorial/Data Structure/Stack - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FCSharp_Tutorial%2FData_Structure%2FStack"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Stack&amp;action=history"/>
		<updated>2026-04-30T03:17:53Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Stack&amp;diff=5577&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Stack&amp;diff=5577&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Stack&amp;diff=5578&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/CSharp_Tutorial/Data_Structure/Stack&amp;diff=5578&amp;oldid=prev"/>
				<updated>2010-05-26T12:15:57Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Clear a stack==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
class MainClass&lt;br /&gt;
{&lt;br /&gt;
  static void Main(string[] args)&lt;br /&gt;
  {&lt;br /&gt;
    Stack a = new Stack(10);&lt;br /&gt;
    int x = 0;&lt;br /&gt;
    a.Push(x);&lt;br /&gt;
    x++;&lt;br /&gt;
    a.Push(x);&lt;br /&gt;
    foreach (int y in a)&lt;br /&gt;
    {&lt;br /&gt;
      Console.WriteLine(y);&lt;br /&gt;
    }&lt;br /&gt;
    a.Pop();&lt;br /&gt;
    a.Clear();&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;1&lt;br /&gt;
0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Pop and Peek==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
    public class Tester&lt;br /&gt;
    {&lt;br /&gt;
        static void Main()&lt;br /&gt;
        {&lt;br /&gt;
            Stack&amp;lt;Int32&amp;gt; intStack = new Stack&amp;lt;Int32&amp;gt;();&lt;br /&gt;
            for (int i = 0; i &amp;lt; 8; i++)&lt;br /&gt;
            {&lt;br /&gt;
                intStack.Push(i * 5);&lt;br /&gt;
            }&lt;br /&gt;
            PrintValues(intStack);&lt;br /&gt;
            Console.WriteLine(&amp;quot;\n(Pop)\t{0}&amp;quot;,intStack.Pop());&lt;br /&gt;
            PrintValues(intStack);&lt;br /&gt;
            Console.WriteLine(&amp;quot;\n(Pop)\t{0}&amp;quot;,intStack.Pop());&lt;br /&gt;
            PrintValues(intStack);&lt;br /&gt;
            Console.WriteLine(&amp;quot;\n(Peek) \t{0}&amp;quot;,intStack.Peek());&lt;br /&gt;
            PrintValues(intStack);&lt;br /&gt;
            int[] targetArray = new int[12];&lt;br /&gt;
            for (int i = 0; i &amp;lt; targetArray.Length; i++)&lt;br /&gt;
            {&lt;br /&gt;
                targetArray[i] = i * 100 + 100;&lt;br /&gt;
            }&lt;br /&gt;
            PrintValues(targetArray);&lt;br /&gt;
            intStack.CopyTo(targetArray, 6);&lt;br /&gt;
            PrintValues(targetArray);&lt;br /&gt;
        }&lt;br /&gt;
        public static void PrintValues(IEnumerable&amp;lt;Int32&amp;gt; myCollection)&lt;br /&gt;
        {&lt;br /&gt;
            IEnumerator&amp;lt;Int32&amp;gt; enumerator =myCollection.GetEnumerator();&lt;br /&gt;
            while (enumerator.MoveNext())&lt;br /&gt;
                Console.Write(&amp;quot;{0} &amp;quot;, enumerator.Current);&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Push and pop value==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System; &lt;br /&gt;
using System.Collections; &lt;br /&gt;
  &lt;br /&gt;
class StackDemo { &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
  public static void Main() { &lt;br /&gt;
    Stack st = new Stack(); &lt;br /&gt;
 &lt;br /&gt;
    st.Push(1); &lt;br /&gt;
    st.Push(2); &lt;br /&gt;
    foreach(int i in st) &lt;br /&gt;
      Console.Write(i + &amp;quot; &amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    st.Push(1); &lt;br /&gt;
 &lt;br /&gt;
    Console.Write(&amp;quot;stack: &amp;quot;); &lt;br /&gt;
    foreach(int i in st) &lt;br /&gt;
      Console.Write(i + &amp;quot; &amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine();         &lt;br /&gt;
&lt;br /&gt;
    Console.Write(&amp;quot;Pop -&amp;gt; &amp;quot;); &lt;br /&gt;
    int a = (int) st.Pop(); &lt;br /&gt;
    Console.WriteLine(a); &lt;br /&gt;
 &lt;br /&gt;
    Console.Write(&amp;quot;stack: &amp;quot;); &lt;br /&gt;
    foreach(int i in st) &lt;br /&gt;
      Console.Write(i + &amp;quot; &amp;quot;); &lt;br /&gt;
 &lt;br /&gt;
    Console.WriteLine();         &lt;br /&gt;
  } &lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;2 1 stack: 1 2 1&lt;br /&gt;
Pop -&amp;gt; 1&lt;br /&gt;
stack: 2 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Stack And Queue==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.ruponentModel;&lt;br /&gt;
    class StackAndQueue&lt;br /&gt;
    {&lt;br /&gt;
        static void Main()&lt;br /&gt;
        {&lt;br /&gt;
            Queue&amp;lt;int&amp;gt; queue = new Queue&amp;lt;int&amp;gt;();&lt;br /&gt;
            Stack&amp;lt;int&amp;gt; stack = new Stack&amp;lt;int&amp;gt;();&lt;br /&gt;
            for (int i = 0; i &amp;lt; 10; i++)&lt;br /&gt;
            {&lt;br /&gt;
                queue.Enqueue(i);&lt;br /&gt;
                stack.Push(i);&lt;br /&gt;
            }&lt;br /&gt;
            for (int i = 0; i &amp;lt; 10; i++)&lt;br /&gt;
            {&lt;br /&gt;
                Console.WriteLine(&amp;quot;Stack:{0} Queue:{1}&amp;quot;,&lt;br /&gt;
                                   stack.Pop(), queue.Dequeue());&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>