Comments on: Programming Interview Questions 16: Anagram Strings
/2011/11/17/programming-interview-questions-16-anagram-strings/?utm_source=rss&utm_medium=rss&utm_campaign=programming-interview-questions-16-anagram-strings
Information Retrieval and Machine LearningMon, 23 Jan 2012 19:14:24 +0000hourly1http://wordpress.org/?v=3.3By: Arden
/2011/11/17/programming-interview-questions-16-anagram-strings/#comment-1569
ArdenMon, 23 Jan 2012 00:21:07 +0000/?p=789#comment-1569You're right, now I see it. Thanks a lot for the correction!You’re right, now I see it. Thanks a lot for the correction!
]]>By: Raj
/2011/11/17/programming-interview-questions-16-anagram-strings/#comment-1568
RajSun, 22 Jan 2012 23:53:24 +0000/?p=789#comment-1568xor does'nt work.consider the case of string1="aaaa" and string2="bbbb".for this xor of both string is zero.xor does’nt work.consider the case of string1=”aaaa” and string2=”bbbb”.for this xor of both string is zero.
]]>By: Arden
/2011/11/17/programming-interview-questions-16-anagram-strings/#comment-1269
ArdenFri, 06 Jan 2012 13:07:32 +0000/?p=789#comment-1269That's a great idea, thanks for the comment. Will update the post..That’s a great idea, thanks for the comment. Will update the post..
]]>By: Volkan
/2011/11/17/programming-interview-questions-16-anagram-strings/#comment-1221
VolkanThu, 05 Jan 2012 09:38:10 +0000/?p=789#comment-1221how about using XOR, it reduces memory to O(1).how about using XOR, it reduces memory to O(1).
]]>By: Arden
/2011/11/17/programming-interview-questions-16-anagram-strings/#comment-559
ArdenTue, 22 Nov 2011 05:41:22 +0000/?p=789#comment-559Ok now I see, you're totally right. Thanks a lot for the notice, I'll update the code.Ok now I see, you’re totally right. Thanks a lot for the notice, I’ll update the code.
]]>By: Sameer
/2011/11/17/programming-interview-questions-16-anagram-strings/#comment-558
SameerTue, 22 Nov 2011 05:36:24 +0000/?p=789#comment-558But you already compare the lengths of the strings first.
I mean not a big deal to compare again, I was just making sure that I am not missing any case..But you already compare the lengths of the strings first.
I mean not a big deal to compare again, I was just making sure that I am not missing any case..
]]>By: Arden
/2011/11/17/programming-interview-questions-16-anagram-strings/#comment-557
ArdenTue, 22 Nov 2011 05:34:04 +0000/?p=789#comment-557Because string1 may contain extra characters. For example if string1='abc' and string2='ab', the loops would complete just fine but we should check for that extra character 'c' in the end. To be sure that each letter has exact same count in both strings.Because string1 may contain extra characters. For example if string1=’abc’ and string2=’ab’, the loops would complete just fine but we should check for that extra character ‘c’ in the end. To be sure that each letter has exact same count in both strings.
]]>By: Sameer
/2011/11/17/programming-interview-questions-16-anagram-strings/#comment-553
SameerTue, 22 Nov 2011 03:15:11 +0000/?p=789#comment-553Hey Arden,
Why the last "sum(counts.values())==0" check is required? If it reaches there, wouldn't it always be 0?Hey Arden,
Why the last “sum(counts.values())==0″ check is required? If it reaches there, wouldn’t it always be 0?