[algogeeks] Design a method to find the frequency of occurrences of any given word in a book.

2012-10-24 Thread rahul sharma
-- 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

[algogeeks] C o/p adobe

2012-10-24 Thread rahul sharma
Pleaase reply with sol as asp Fille 1: #includestdio.h extern int i; extern int j; void next(void); int main() { ++i; printf(%d,i); next(); getchar(); } int i=3; void next() { ++i; printf(%d,i); printf(%d,j); other(); } File 2: extern int i; void other() { ++i;

[algogeeks] second smallest in array

2012-10-24 Thread rahul sharma
for this shall we process all items and parallely calculate first and second max. or tournament methos i best for thsi.. if tournament method is best can anybody provide me with code with tournament method to find second smallest.. -- You received this message because you are subscribed to

Re: [algogeeks] Design a method to find the frequency of occurrences of any given word in a book.

2012-10-24 Thread atul anand
Trie or hash map can b used On 10/24/12, rahul sharma rahul23111...@gmail.com wrote: -- 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

[algogeeks] http://www.whistletalk.com

2012-10-24 Thread Mahesh Gunda
Hi All, WhistleTalk is start up started by some of my seniors. Please register yourself. http://www.whistletalk.com (Hire the best | Help friends | Get a referral bonus | Stay informed) Thanks, Mahesh -- You received this message because you are subscribed to the Google Groups Algorithm

[algogeeks] Directi Campus Internship paper

2012-10-24 Thread Ujjwal Arora
We had to code 2 questions in 1.30 hr on codechef only. the questions are as follow : 1.) Implement Least Recently Used (LRU) algorithm - a well known algorithm of operating systems. 2.) Find if a given number is Trojan Number. A Trojan number is a number which is strong but not a perfect

Re: [algogeeks] Design a method to find the frequency of occurrences of any given word in a book.

2012-10-24 Thread ----KH@D@R B@SH@----
Algorithm: use a map of string and int mapstring,intfreq; first scan the book to calculate the frequency of occurrences of each word now just print the value for the given word disadvantage: complete words needs to be scanned time complexity:O(number of total words present in a book) On

Re: [algogeeks] second smallest in array

2012-10-24 Thread sangeeta goyal
http://ideone.com/FqnSq see the link for tournament method On Wed, Oct 24, 2012 at 5:12 PM, rahul sharma rahul23111...@gmail.comwrote: for this shall we process all items and parallely calculate first and second max. or tournament methos i best for thsi.. if tournament method is best can

Re: [algogeeks] C o/p adobe

2012-10-24 Thread SHOBHIT GUPTA
http://www.geeksforgeeks.org/archives/840 By default, the declaration and definition of a C function have “extern” prepended with them. It means even though we don’t use extern with the declaration/definition of C functions, it is present there. For example, when we write. int foo(int arg1,

Re: [algogeeks] C o/p adobe

2012-10-24 Thread rahul sharma
Then why its not running? On Wed, Oct 24, 2012 at 6:50 PM, SHOBHIT GUPTA shobhitgupta1...@gmail.comwrote: http://www.geeksforgeeks.org/archives/840 By default, the declaration and definition of a C function have “extern” prepended with them. It means even though we don’t use extern with the

Re: [algogeeks] C o/p adobe

2012-10-24 Thread rahul sharma
can nyone provide me dummy code of how exactly to use extern in c.. in dev environment when i declare int i in one fyl and try use use with extern int i in another then it doesnt compile..plz coment On Wed, Oct 24, 2012 at 9:58 PM, rahul sharma rahul23111...@gmail.comwrote: Then why its not

[algogeeks] Adobe written test question

2012-10-24 Thread rahul sharma
int arr[10] // in fyl 1 now in fyl 2 extern int *arr void foo() { arr[0]=10; } what kind of problem can be there?in what condition and y? plz comment -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

[algogeeks] Re: Does recusrion creates array or its by address??

2012-10-24 Thread rahul sharma
I think it is overwritng old values when child end..parent overwrite old value with new..m i ryt? On Thu, Oct 25, 2012 at 3:00 AM, rahul sharma rahul23111...@gmail.comwrote: I wana ask that when we pass array by recursion then as we know formal parameters are passed by value and array by base

[algogeeks] Re: Directi Campus Internship paper

2012-10-24 Thread Dave
@Ujjwal: Here's an algorithm for problem 2: Given a number n, form the prime number factorization of n: n = p1^k1 * p2^k2 * ... * pm^km, where the pi are distinct primes and ^ represents exponentiation. If any ki = 1, terminate the factorization and report that n is not a Trojan number.

[algogeeks] Re: Compute modulus division by a power-of-2-number

2012-10-24 Thread Dave
@Rahul: If d is a power of 2, say 2^k, where ^ represents exponentiation, then the binary representation of d is a 1-bit followed by k 0-bits. Then d-1 is the binary number comprising k 1-bits. Anding this with n keeps only the low-order k bits of n, which you can see to be n%d. Dave On

Re: [algogeeks] Re: Directi Campus Internship paper

2012-10-24 Thread bharat b
LRU implementation : -Maintain a double linked list which stores LRU items(say 50). -Keep one head and tail pointers of the linked list. -Maintain a hash table which has value of the linked list as key and memory location of that node as value. - When ever hash table doesn't