Re: [algogeeks] Questions on Hashing ...Share ur ideas...
Solution for Problem 4: #include #define size 10 //size = sizeof(arr); #define max 8 //max = maxof(arr[])+1; using namespace std; int main() { int arr[] = {2,4,6,4,6,3,5,1,5,7}, hasharr[max] = {0}, i, sum=8; for(i=0; ihttp://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] doubt in checking if 2 strings are anagrams
#include #include using namespace std; int main() { char str1[] = "sdfgkirertyujvcheddirtyutrdfgrtyuigfkrertyuijhgfdshh"; char str2[] = "redirtyhgfdshhrtyrsujvcheierdutrdfgrtyuigfkdfgktyuij"; int len1 = strlen(str1), len2 = strlen(str2); if(len1 != len2) { cout<<"Both are not anagram of each other."; return 0; } else { int rep_char1[26] = {0}, rep_char2[26] = {0}, i; for(i=0; ihttp://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] doubt in checking if 2 strings are anagrams
for long strings, the values will be larger. a simple approach could be to store occurrence of each char of both the strings in an integer array of size 26 and if both the arrays are same then the two strings are anagrams. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] Re: Facebook Interview question at NIT Warangal
#include #define ARR_LEN 5 using namespace std; int main() { int int_arr[ARR_LEN], k, min, max, x, temp, i; for(i=0; i>int_arr[i]; cout<<"Enter k: "; cin>>k; min = (1<>2)/(x&(-x ) { temp = x; i = 0; while(temp) { if(temp&1) cout<>1; } cout
Re: [algogeeks] Nagarro Coding Round Ques......
#include #include using namespace std; int main() { char str[] = "viikk"; int rep[26] = {0}; int i, len = strlen(str); int num_odd=0; for(i=0; i1) { cout<<"Can not be a pallindrome."; return 0; } } } cout<<"A pallindrome can be formed."; return 0; } -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
Re: [algogeeks] puzzle-plz explain stepwise
1st: "xy" 2nd: "yx" 3rd: "x0y" -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.