Can I Find the Nth Lexicographic Subset in Less Than O(N^2) Time?

Правка en1, от vamaddur, 2017-07-19 12:19:47

Given a set {a, b, c, d}, its non-empty subsets in lexicographic order are as follows: {a, ab, abc, abcd, abd, ac, acd, ad, b, bc, bcd, bd, c, cd, d}

I found an O(N^2) method of finding the Nth lexicographically smallest subset here, but I was wondering if there was a faster way to do this.

I know that finding the Nth lexicographically smallest string can be reduced from O(N^2) time to O(N) time, which motivated me to ask this question about a similar reduction for subsets.

Please help, and thanks in advance!

Теги subset, lexicography

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский vamaddur 2017-07-19 15:33:25 35
en1 Английский vamaddur 2017-07-19 12:19:47 638 Initial revision (published)