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

推荐订阅源

N
Netflix TechBlog - Medium
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
Stack Overflow Blog
Stack Overflow Blog
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
人人都是产品经理
人人都是产品经理
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog
MongoDB | Blog
MongoDB | Blog
L
LangChain Blog
WordPress大学
WordPress大学
小众软件
小众软件
IT之家
IT之家
腾讯CDC
月光博客
月光博客
量子位
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 大天使泰瑞尔

通过反射机制控制前台的数据项的显示和隐藏 由partition看窗口函数 IE 6下CSS浮动样式的问题 转载一篇拼SQL字符串的语句 ASP.NET 2.0 中控件的简单异步回调 新手基础知识专用 今天终于学会了从客户端调用Web Service 学会了ASP.NET 2.0中的数据批量更新 - 大天使泰瑞尔 - 博客园 数据结构学习(5):链表 数据结构学习(4):栈 数据结构学习(3):堆化优先队列 数据结构学习(2):汉诺塔问题 数据结构学习(1):搜索二叉树 冒泡算法的三种JavaScript表示 YUI学习(1):ToolTip的用法 XML学习失误系列(2):分清节点性质,使用nodeValue JavaScript&DHTML特效学习(1):MSN提示框 YUI的Drap&Drop对IE7不支持 Gmail邮箱可以直接注册了
数据结构学习(6):队列
大天使泰瑞尔 · 2006-12-14 · via 博客园 - 大天使泰瑞尔

using System;

namespace DstrQueue
{
    
/// <summary>
    
/// Class1 的摘要说明。
    
/// </summary>

    class QueueNode
    
{
        Object item;
        QueueNode link;
    }

    
class Queue
    
{
        
/// <summary>
        
/// 应用程序的主入口点。
        
/// </summary>

        [STAThread]
        
static void Main(string[] args)
        
{
            
//
            
// TODO: 在此处添加代码以启动应用程序
            
//
        }

        
private QueueNode front;
        
private QueueNode rear;
        
private int count;

        
public boolean empty()
        
{
            
return (count==0);
        }


        
public void insert(Object newItem)
        
{
            QueueNode temp
=new QueueNode();
            temp.item
=newItem;
            temp.link
=null;
            
if(rear==null)
            
{
                front
=rear=temp;
            }

            
else
            
{
                rear.link
=temp;
                rear
=temp;
            }

            count
++;
        }

        
public Object remove()
        
{
            
if(count==0)
                
return null;
            
else
            
{
                Object tempItem
=front.item;
                front
=front.link;
                
if(front==null)
                
{
                    rear
=null;
                }

                count
--;
                
return tempItem;
            }

        }

    }

}

posted @ 2006-12-14 19:08  大天使泰瑞尔  阅读(318)  评论(1)    收藏  举报

刷新页面返回顶部