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 Learning Mon, 23 Jan 2012 19:14:24 +0000 hourly 1 http://wordpress.org/?v=3.3 By: Arden /2011/11/17/programming-interview-questions-16-anagram-strings/#comment-1569 Arden Mon, 23 Jan 2012 00:21:07 +0000 /?p=789#comment-1569 You'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 Raj Sun, 22 Jan 2012 23:53:24 +0000 /?p=789#comment-1568 xor 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 Arden Fri, 06 Jan 2012 13:07:32 +0000 /?p=789#comment-1269 That'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 Volkan Thu, 05 Jan 2012 09:38:10 +0000 /?p=789#comment-1221 how 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 Arden Tue, 22 Nov 2011 05:41:22 +0000 /?p=789#comment-559 Ok 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 Sameer Tue, 22 Nov 2011 05:36:24 +0000 /?p=789#comment-558 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.. 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 Arden Tue, 22 Nov 2011 05:34:04 +0000 /?p=789#comment-557 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. 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 Sameer Tue, 22 Nov 2011 03:15:11 +0000 /?p=789#comment-553 Hey 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?

]]>