User talk:Tonyjv: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Sort instead of max in Anagrams: You need max. Why sort?)
Line 13: Line 13:


:How is sorting everything for just the largest value 'better' than just explicitely finding the largest? Isn't the latter more clear? --[[User:Paddy3118|Paddy3118]] 18:14, 20 September 2011 (UTC)
:How is sorting everything for just the largest value 'better' than just explicitely finding the largest? Isn't the latter more clear? --[[User:Paddy3118|Paddy3118]] 18:14, 20 September 2011 (UTC)

Because it is not '''a maximum''' but all maximums, same way as groupby need sorted input to do the same. We want all cases when the maximum is reached and it is done more economically (not tested but by my intuition) by sorting the anagrams by number of anagrams in first place. Then we can do printing out result very economically without full pass of groups (including taking each length again) --[[User:Tonyjv|Tonyjv]] 20:43, 20 September 2011 (UTC)

Revision as of 20:43, 20 September 2011

Can we talk about your Python edits please?

Hi, I have spent time, and looked at most of your edits and disagreed with them. Is it possible that we could talk about our respective views on your edits, and maybe invite others for their views too so we can reach a consensus?

The site is a collaborative wiki, so it would be great if several people gave their input on this, so please speak up!
Thanks --Paddy3118 21:23, 30 June 2010 (UTC)

Have been busy with DaniWeb (member of month in April) and trying to do some work so Have not checked these pages for ages. Now I am looking into getting involved also with Go language, so I came back to these pages and saw your comment long time ago.

Sort instead of max in Anagrams

Hi Tony, If you only use the max value in your Anagrams#Python entry, why change from using max to using sort? Thanks, --Paddy3118 11:26, 19 September 2011 (UTC)

Because it pays of when looping to give all that length solutions, see the break in the loop and compare it to other solution.--Tonyjv 16:10, 20 September 2011 (UTC)

How is sorting everything for just the largest value 'better' than just explicitely finding the largest? Isn't the latter more clear? --Paddy3118 18:14, 20 September 2011 (UTC)

Because it is not a maximum but all maximums, same way as groupby need sorted input to do the same. We want all cases when the maximum is reached and it is done more economically (not tested but by my intuition) by sorting the anagrams by number of anagrams in first place. Then we can do printing out result very economically without full pass of groups (including taking each length again) --Tonyjv 20:43, 20 September 2011 (UTC)