Please Visit: http://ift.tt/1ajReyV
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1lRv1gV
via LifeLong Community
World of BROCK: How to find the longest continuous increasing sequence: algorithms, puzzles, howto's and stuff... interview questions..etc
The idea for the O(n) solution is to keep track of the start of the longest continuous increasing sequence and it's length. At each item, if it's bigger than the previous, then we have a sequence. If it's longer then the current maximum length, then we have a new longest increasing sequence, longer than the previous one.
http://ift.tt/1pXvMxi
http://ift.tt/1pXvK8S
The idea for the O(n) solution is to keep track of the start of the longest continuous increasing sequence and it's length. At each item, if it's bigger than the previous, then we have a sequence. If it's longer then the current maximum length, then we have a new longest increasing sequence, longer than the previous one.
http://ift.tt/1pXvMxi
http://ift.tt/1pXvK8S
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1lRv1gV
via LifeLong Community
No comments:
Post a Comment