文件名称:IsStackPerms
介绍说明--下载内容均来自于网络,请自行研究使用
Write two C++ programs (using STL preferably) to solve the stack permutation
problem discussed in Chapter 3 of the textbook.
(a) (5 ) Problem 1: Print all possible stack permutations of an incoming train of n elements.
(command line format example): allsp <no. of elements in the incoming train>
Try to execute your program when n equals 5. In addition to printing all possible stack
permutations, report the total number of them.
(b) (5 ) Problem 2: Check if a given permutation is producible by the stack permutation.
(command line format example): issp <a file containing a given permutation>
Execute your program to check if the following sequence is a valid stack permutation:
4 6 5 8 10 9 7 3 2 1 (output order: from left to right)
Simply answer YES or NO in your report.
-Write two C++ programs (using STL preferably) to solve the stack permutation
problem discussed in Chapter 3 of the textbook.
(a) (5 ) Problem 1: Print all possible stack permutations of an incoming train of n elements.
(command line format example): allsp <no. of elements in the incoming train>
Try to execute your program when n equals 5. In addition to printing all possible stack
permutations, report the total number of them.
(b) (5 ) Problem 2: Check if a given permutation is producible by the stack permutation.
(command line format example): issp <a file containing a given permutation>
Execute your program to check if the following sequence is a valid stack permutation:
4 6 5 8 10 9 7 3 2 1 (output order: from left to right)
Simply answer YES or NO in your report.
problem discussed in Chapter 3 of the textbook.
(a) (5 ) Problem 1: Print all possible stack permutations of an incoming train of n elements.
(command line format example): allsp <no. of elements in the incoming train>
Try to execute your program when n equals 5. In addition to printing all possible stack
permutations, report the total number of them.
(b) (5 ) Problem 2: Check if a given permutation is producible by the stack permutation.
(command line format example): issp <a file containing a given permutation>
Execute your program to check if the following sequence is a valid stack permutation:
4 6 5 8 10 9 7 3 2 1 (output order: from left to right)
Simply answer YES or NO in your report.
-Write two C++ programs (using STL preferably) to solve the stack permutation
problem discussed in Chapter 3 of the textbook.
(a) (5 ) Problem 1: Print all possible stack permutations of an incoming train of n elements.
(command line format example): allsp <no. of elements in the incoming train>
Try to execute your program when n equals 5. In addition to printing all possible stack
permutations, report the total number of them.
(b) (5 ) Problem 2: Check if a given permutation is producible by the stack permutation.
(command line format example): issp <a file containing a given permutation>
Execute your program to check if the following sequence is a valid stack permutation:
4 6 5 8 10 9 7 3 2 1 (output order: from left to right)
Simply answer YES or NO in your report.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
IsStackPerms.cpp