有没有7寸带笔的板子?# PDA - 掌中宝
p*o
1 楼
www.careercup.com/question?id=11978701f
Given an array of integers, find the longest subsequence of elements which
monotonically increases. for ex. array = {1 4 8 2 5 7 3 4 6}, the longest
subsequence = {1 2 3 4 6}
I have explained him about O(N^2) with O(1) space algorithm but the
interview is expecting O(N log N). Could any one help me explaining the
algorithm in detail ?
Given an array of integers, find the longest subsequence of elements which
monotonically increases. for ex. array = {1 4 8 2 5 7 3 4 6}, the longest
subsequence = {1 2 3 4 6}
I have explained him about O(N^2) with O(1) space algorithm but the
interview is expecting O(N log N). Could any one help me explaining the
algorithm in detail ?