Talk:Anagrams/Deranged anagrams

Revision as of 13:13, 30 October 2020 by Nig (talk | contribs) (Comment on AppleScript comment: no problem.)

Cross-language performance comparisons

+1 on Ledrugs deletions. Anothers persons comparison could be wildly different. --Paddy3118 04:53, 27 September 2011 (UTC)

User user:79.11.51.165 commented:

"qualitative performance comparisons done on the same PC are probably OK on Rosettacode"

when removing the comment on a comparison between two examples in the same language, D. Too many things have to be set-up and monitored as equivalent, as well as reported as equivalent for all but the fuzziest of reports on relative performance between examples in the same language to be reported, as otherwise their would need to be a wealth of qualifying information. In general, as you can see, there is very little timing information on RC, but the odd comment along the lines of "This second D example consistantly ran faster than the other" is usually left, but even this implies things about the test environment, as well as the code itself, as who is likely to re-run to confirm fuzzy timings when code edits are made, and such a comment might assume a particular compiler version. If you start to add all that extra context explicitely you then don't know when to stop... (I shall stop here howev
--Paddy3118 05:11, 27 September 2011 (UTC)

Comment on Applescript comment

"The task description implies that there's just one longest deranged anagram in the file, so this solution only examines instances where exactly two words share the same characters and returns the first longest deranged pair found."

It seems that finding the longest would need to find all derangement lengths to determine the longest, but I guess only one of maximum current length would need to be retained in a possible algorithm.

"... a policy about what to do where three or more words share the same characters and at least one is deranged against all the others but the others aren't necessarily deranged amongst themselves."

Deranged pairs could be shown with possible repetition between pairs of a single word.
--Paddy3118 (talk) 17:46, 29 October 2020 (UTC)
Hi Paddy3118. Thanks for your interest in the AppleScript solution and in my comments. The second sort in the AppleScript code sorts the words by length as well as grouping them by the letters they contain, so the rest is just working through the list from longest to shortest. It would be easy to adapt the last part to return co-longest deranged pairs.
Your suggestion for what to do about three or more words seems a good one. Now that you've put the idea into my head, I may try implementing it tomorrow to see if it turns up any interestingly different results.  :)
--Nig (talk) 22:28, 29 October 2020 (UTC)
Your comment got me thinking. Please don't take it as criticism of your actual code, your three or more candidates was intriguing 👍 --Paddy3118 (talk) 07:11, 30 October 2020 (UTC)
No problem. I understood your comments to be simply throwing ideas around, but they clarified for me what needed to be done for my own satisfaction. I've now implemented it.  :) --Nig (talk) 13:13, 30 October 2020 (UTC)
Return to "Anagrams/Deranged anagrams" page.