Talk:Ordered words: Difference between revisions

From Rosetta Code
Content added Content deleted
Line 7: Line 7:
:Yes. I find the ordered words, find the maximum length of any ordered word, then find all ordered words of that maximum length. --[[User:Paddy3118|Paddy3118]] 13:09, 10 November 2010 (UTC)
:Yes. I find the ordered words, find the maximum length of any ordered word, then find all ordered words of that maximum length. --[[User:Paddy3118|Paddy3118]] 13:09, 10 November 2010 (UTC)
:: For contrast, the Tcl code does it in a single pass. (It happened to be more natural to express it that way.) The result is the same though; the words in the result list are such that they are all of the same length, all ordered words, and there is no other ordered word (in the originating dictionary) such that its length is greater than the length of any result word. (Also, every ordered word of that length in the originating dictionary is present in the result.) I can't be bothered to write that mathematically. :-) –[[User:Dkf|Donal Fellows]] 16:24, 10 November 2010 (UTC)
:: For contrast, the Tcl code does it in a single pass. (It happened to be more natural to express it that way.) The result is the same though; the words in the result list are such that they are all of the same length, all ordered words, and there is no other ordered word (in the originating dictionary) such that its length is greater than the length of any result word. (Also, every ordered word of that length in the originating dictionary is present in the result.) I can't be bothered to write that mathematically. :-) –[[User:Dkf|Donal Fellows]] 16:24, 10 November 2010 (UTC)

==Knotty problem==
I noticed three of the examples written by [[User talk:Ulrie]], C++, Perl and Perl 6; don't have the word knotty mentioned. I don't know if this is due to a faulty copy of the dictionary or a faulty algorithm. (Knotty is still in the [http://www.puzzlers.org/pub/wordlists/unixdict.txt dictionary]). I will give it a day then I think I should mark them incorrect? --[[User:Paddy3118|Paddy3118]] 12:05, 27 November 2010 (UTC)

Revision as of 12:05, 27 November 2010

Lexicographical order

Note: This task should probably be modified to be aware (and tolerant) of lexicographical order. --Michael Mol 22:15, 9 November 2010 (UTC)

I think it's probably not important on that particular dictionary; it's all lower case and well-behaved. –Donal Fellows 22:37, 9 November 2010 (UTC)

longest word length

By "longest word length", do you mean "equal to the length of the longest ordered word"? --Michael Mol 22:16, 9 November 2010 (UTC)

Yes. I find the ordered words, find the maximum length of any ordered word, then find all ordered words of that maximum length. --Paddy3118 13:09, 10 November 2010 (UTC)
For contrast, the Tcl code does it in a single pass. (It happened to be more natural to express it that way.) The result is the same though; the words in the result list are such that they are all of the same length, all ordered words, and there is no other ordered word (in the originating dictionary) such that its length is greater than the length of any result word. (Also, every ordered word of that length in the originating dictionary is present in the result.) I can't be bothered to write that mathematically. :-) –Donal Fellows 16:24, 10 November 2010 (UTC)

Knotty problem

I noticed three of the examples written by User talk:Ulrie, C++, Perl and Perl 6; don't have the word knotty mentioned. I don't know if this is due to a faulty copy of the dictionary or a faulty algorithm. (Knotty is still in the dictionary). I will give it a day then I think I should mark them incorrect? --Paddy3118 12:05, 27 November 2010 (UTC)