I have this problem as homework, and I just don’t know where to start. I implemented a solution using a recursive algorithm (# 1), but I just can't figure out how to solve the problem using the stack ... any help would be great.
Find the longest ascending sequence of numbers in the 15 x 15 array. For example, if the 4x4 array contains
97 47 56 36
35 57 41 13
89 36 98 75
25 45 26 17
then the longest ascending sequence of numbers is a sequence of length eight, consisting of 17, 26, 36, 41, 47, 56, 57, 97. Note that there are no duplicates in the increasing sequence.
source
share