JS(TS)ベースのレビュー()スタックのデータ構造

ここに画像を挿入説明
串は、キューを引くスタック食べている食べます

スタックは、最後のアウトです
ここに画像を挿入説明
ここに画像を挿入説明
ここに画像を挿入説明

class Stack{
  private items:number[] = []
  push(element:number){
    this.items.push(element);
  } //进栈
  pop():number{
    return this.items.pop()
  }//出栈
}
let stack = new Stack();
stack.push(1);
stack.push(2);
stack.push(3);
console.log(stack.pop());
console.log(stack.pop());
console.log(stack.pop());

// 2.代码结构的运行方式
function one(){
  function two(){
    function three(){
      debugger

    }
    three();
  }
  two();

}
one();
公開された98元の記事 ウォンの賞賛4 ビュー20000 +

おすすめ

転載: blog.csdn.net/weixin_42416812/article/details/105292324