0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

スタックのデータ出力順序

Posted at

応用情報技術者平成28年春期 午前5

A,B,Cの順序で入力されるデータがある。各データについてスタックへの挿入と取出しを1回ずつ行うことができる場合,データの出力順序は何通りあるか。

image.png

1、A,B,Cの考えられる出力順序:

[A→B→C]
AABBCC
[A→C→B]
AABCCB
[B→A→C]
ABBACC
[B→C→A]
ABBCCA
[C→A→B]
ABCCAB × Bより先にAを出力できません。
[C→B→A]
ABCCBA

合せて、5種類です。

参照:
https://www.ap-siken.com/kakomon/28_haru/q5.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?