惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - light's cafe

BitVector32结构学习 转贴一篇关于BitVector32的Blog 依赖单元测试开发 调整过的书籍目录 今天晚上的遭遇 设计,UML,测试驱动开发 看牙记 我是LIGHT的LP,今天由我代笔 明天去买干粒猫粮 面向接口编程 关于测试驱动开发的文章 今天我只睡了三个小时 强命名程序集 我,我 庆祝一下 看兽医记 程序集文件中的版本号 AL链接器 怪事时时有不如昨天多
Queue和Stack的学习代码
light's cafe · 2004-08-23 · via 博客园 - light's cafe

using System;
using System.Collections;
using System.Windows.Forms;

namespace Lightsoftware
{
 #region <summary>
 /// <summary>
 ///
 /// </summary>
 #endregion
 public class MyClass: Object
 {
  public static void Main(String[] args)
  {
   TestQueue();
   TestStack();
  }

  private static void TestQueue()
  {
   Queue queue = new Queue();   
   queue.Enqueue(5);
   queue.Enqueue(7);
   queue.Enqueue(9);

   Int32 count = queue.Count;

   //output 5, 7, 9
   for (Int32 index = 0; index < count; ++index)
   {
    MessageBox.Show(((Int32)queue.Dequeue()).ToString());
   }
  }

  public static void TestStack()
  {
   Stack stack = new Stack();
   stack.Push(5);
   stack.Push(7);
   stack.Push(9);

   Int32 count = stack.Count;
   
   //output 9, 7, 5
   for (Int32 index = 0; index < count; ++index)
   {
    MessageBox.Show(((Int32)stack.Pop()).ToString());
   }
  }
 }
}