Subsequence Problem

Правка en1, от harrypotter0, 2017-09-19 16:52:12

Given an int array which might contain duplicates, find the largest subset of it which form a sequence. Ex: {1,6,10,4,7,9,5} then ans is 4,5,6,7

Sorting is an obvious solution. Can this be done in O(n) time ??

Thanks in advance :)

Теги sorting, increasing subsequence

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский harrypotter0 2017-09-19 16:52:12 262 Initial revision (published)