• ----:)欢迎访问源码网(:----
    • 首页
    • 博客
    • 学院
    • 下载
    • 论坛
    • 影视
    • 发布源码
    • RSS
    • ITPig
    • 笑话网
    • 百家姓
    • 繁體中文

源码网 - 中国第一源码门户
选择镜像:网通镜像 - 电信主站
  • 首 页
  • 新闻动态
  • 网站运营
  • 网页制作
  • WEB开发
  • 编程开发
  • 图像媒体
  • 操作系统
  • 数据库
  • 服务器
热门搜索 优化 SEO 故事 cms IIS7 MySQL 个人 AdSense 主题推广 | 文章搜索: 高级搜索
会员登录/控制面版您的位置: 学院首页 >> WEB开发 >> ASP开发 >> 系统相关 >> 详细内容
 

推荐文章

 
 

热点文章

  • ASP+中文教程
  • 展现 C#
  • ASP+上传文件语法
  • 如何在ASP+中发送邮件
  • asp+的几个特点
  • ASP控制计算机函数ADSI发表
  • asp+初体验---用c#写的asp+域名查询程序
  • ASP+中执行简单的Select查询,并返回数据表到DataGrid
  • ASP+数据库操作例子
  • ASP+ 跟踪
  • 一份ASP内存的释放的实验报告
  • ASP+页缓存OutputCache Duration用法
 
 

相关文章

  • ASP+中GetTitleAuthors和PutTitleAuthors应用例子
  • ASP+页缓存OutputCache Duration用法
  • ASP+中执行简单的Select查询,并返回数据表到DataGrid
  • 让您的主页支持各种浏览设备(ASP+篇)
  • ASP+培训教材
  • 如何在ASP+中发送邮件
  • ASP+数据库操作例子
  • 转换ASP到ASP+
  • asp+与asp的区别
  • 突破性的ASP+技术
  • asp+语法介绍
  • Active Server Pages + 介绍
 
 

百度搜索

 
 

C# 堆栈实现

  • 阅览次数:
  • 文章来源: 网海之贝
  • 原文作者: 佚名
  • 整理日期: 2006-10-03
  • 发表评论
  • 字体大小:
  • 小
  • 中
  • 大

namespace Stack{
  using System;
  public class Stack
  {
    private Node first = null;
    private int count = 0;
/***********************************************Property Procedures do not accept any parameters. Note the
diff in the function definition (no parenthesis)************************************************/
    public bool Empty
    {/*******************************************Property
GetProcedure********************************************/
       get
      {
        return (first == null);
      }
    }
    public int Count
    {/*******************************************Property Get
Procedure********************************************/
     get
    {      return count;    }  }
  public object Pop()
  {
    if (first == null)
    {
      throw new InvalidOperationException ("Cant pop from an empty stack");
    }
    else
    {
      object temp = first.Value;
      first = first.Next;
      count--;
      return temp;
    }
  }
  public void Push(object o)
  {
    first = new Node(o, first);
    count++;
  }
  class Node
  {
    public Node Next;
    public object Value;
    public Node(object value) :
this(value, null) {}
    public Node(object value, Node next)
   {

      Next = next;
      Value = value;
    }
  }}
class StackTest{
  static void Main()
  {    Stack s = new Stack();
   if (s.Empty)
      Console.WriteLine("Stack is Empty");
    else
      Console.WriteLine("Stack is not Empty");
    for (int i = 0; i < 5; i++)
      s.Push(i);

    Console.WriteLine("Items in Stack {0}", s.Count);

    for (int i = 0; i < 5; i++)
      Console.WriteLine("Popped Item is {0} and the count is {1}", s.Pop(), s.Count);
    s = null;
    }
  }}//*********END OF CODE

//ASPHouse http://asphouse.yeah.net/
       

上一篇:PHP编程技巧:看实例学正则表达式
下一篇:构建支持Master/Slave读写分离的数据库操作类
  • 网友评论:
  • 查看所有评论
  • 我要发表评论
您的网名:
留言主题:
你要发表的内容:

 

关于本站 | 广告联系 | 版权声明 | 网站地图 | 发布软件 | 帮助中心 | 源码论坛

Copyright © 2005-2007 CodePub.Com  程序支持:木翼  滇ICP备05005971号