in reply to Re^7: list of unique strings, also eliminating matching substrings
in thread list of unique strings, also eliminating matching substrings
1. starting with the longest string and continuing in descending order
2. then only appending the non-embeddable strings to $all
like this $all is in average significantly shorter and the tests with index should be faster.
I'm also wondering if the reallocation of new memory when appending to $all could be avoided by starting with a maximal length string and then shortening $all again.
Maybe uniq() from List::MoreUtils is faster or could be completely avoided (after sorting identical strings always appear in a sequence)
All of this highly depends on the nature of the unknown data and should only be tested with identical sets...
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: list of unique strings, also eliminating matching substrings
by BrowserUk (Patriarch) on Jun 03, 2011 at 05:37 UTC | |
by LanX (Saint) on Jun 03, 2011 at 11:52 UTC | |
by BrowserUk (Patriarch) on Jun 03, 2011 at 14:38 UTC | |
by LanX (Saint) on Jun 03, 2011 at 15:02 UTC | |
by BrowserUk (Patriarch) on Jun 03, 2011 at 15:20 UTC | |
|