mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 21:24:53 +08:00
Fine tune
This commit is contained in:
@ -22,6 +22,7 @@ namespace hello_algo.chapter_stack_and_queue
|
||||
stack.Push(2);
|
||||
stack.Push(5);
|
||||
stack.Push(4);
|
||||
// 请注意,stack.ToArray() 得到的是倒序序列,即索引 0 为栈顶
|
||||
Console.WriteLine("栈 stack = " + string.Join(",", stack.ToArray()));
|
||||
|
||||
/* 访问栈顶元素 */
|
||||
|
||||
Reference in New Issue
Block a user