Page 1 of 1

Design a function bool validateStackSequences(const std::vector& v) that takes an int vector with distinct values,

Posted: Tue Jul 12, 2022 8:04 am
by answerhappygod
Design a function bool validateStackSequences(conststd::vector<int>& v) that takes an int vector withdistinct values, and returns if values in v could be avalid sequence of stack operations (see Wednesday’s classnotes.)
You may assume the input values are always{1, 2, 3, 4, 5}.
step 1
expected output:
truefalsetruefalsetrue
Check It!
NOTE: please add std:: before vector (mymistake of not writing full name for vector.)