zoukankan
html css js c++ java
C# 集合类(二):Queue
Queue
:队列,表示对象的先进先出集合。Enqueue方法入队列,Dequeue方法出队列。
using
System;
using
System.Collections.Generic;
using
System.Text;
using
System.Collections;
namespace
ConsoleApplication1
{
class
Program
{
static
void
Main(
string
[] args)
{
Queue qu
=
new
Queue();
Queue qu2
=
new
Queue();
foreach
(
int
i
in
new
int
[
4
]
{
1
,
2
,
3
,
4
}
)
{
qu.Enqueue(i);
//
入队
qu2.Enqueue(i);
}
foreach
(
int
i
in
qu)
{
Console.WriteLine(i);
//
遍历
}
qu.Dequeue();
//
出队
Console.WriteLine(
"
Dequeue
"
);
foreach
(
int
i
in
qu)
{
Console.WriteLine(i);
}
qu2.Peek();
//
返回位于 Queue 开始处的对象但不将其移除。
Console.WriteLine(
"
Peek
"
);
foreach
(
int
i
in
qu2)
{
Console.WriteLine(i);
}
}
}
}
查看全文
相关阅读:
Struts2-1.配置&与第一个应用
1.rs.first()、rs.last()、rs.next()、rs.getRow()
网页跳转
js---DOM元素节点
4、BufferedIn(out)putStream--->字节输入/输出流的缓冲区类(高效类:高效率读写)
3、FileInputStream--->类文件输入流(读取文件数据)
2、FileOutputStream--->文件输出流(向文件写入数据)
1、IO输入&输出流 简介
OutOfMemoryError系列
Spark调优,性能优化
原文地址:https://www.cnblogs.com/wf225/p/1037811.html
最新文章
How far away(DFS+vector存图)
vue使用--vuex快速学习与使用
http请求与响应
HTML
CSS
流体布局、响应式布局
Nodejs介绍及其安装
vue
vue-cli脚手架安装和webpack-simple模板项目生成
Vue Router
热门文章
xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!
Struts2-2.了解struts.xml的查找顺序
Struts2-2.了解struts.xml>package>action>result的name属性
Copyright © 2011-2022 走看看