1emos
Mar 4, 2007, 08:12 AM
Hi,
I would be thankful if you could provide me the solution to the following questions in C:
1. Given 2 files, f1 and f2 with thousands of name each. Find the common names in the two files. Extend this to 3 files.
2. Algorithm to count most user viewed pages.
3. Code to find dot and cross product
4. Write a function that accepts a function pointer and check the procId of the calling process. Check if the process was alive at a specific interval. If yes, then invoke the function (pointed to by the function pointer) else return. Write another function that would take a request from the process to stop the first function
5. You have 50000 html files, some of which contain phone numbers. How would you create a list of all the files which contain phone numbers?
6. Write C code for 'tr' program.
C:\> tr abc xyz <file name>
replaces all occurrences of a by x, b by y and c by z in <file name>
7. Given a sentence, find if a specific word occurs in it.
8. Write the data structure for jigsaw puzzle. Assume that there is some method which can tell if 2 pieces fit together. How would you solve the puzzle, minimizing the number of times the function is called?
I would be thankful if you could provide me the solution to the following questions in C:
1. Given 2 files, f1 and f2 with thousands of name each. Find the common names in the two files. Extend this to 3 files.
2. Algorithm to count most user viewed pages.
3. Code to find dot and cross product
4. Write a function that accepts a function pointer and check the procId of the calling process. Check if the process was alive at a specific interval. If yes, then invoke the function (pointed to by the function pointer) else return. Write another function that would take a request from the process to stop the first function
5. You have 50000 html files, some of which contain phone numbers. How would you create a list of all the files which contain phone numbers?
6. Write C code for 'tr' program.
C:\> tr abc xyz <file name>
replaces all occurrences of a by x, b by y and c by z in <file name>
7. Given a sentence, find if a specific word occurs in it.
8. Write the data structure for jigsaw puzzle. Assume that there is some method which can tell if 2 pieces fit together. How would you solve the puzzle, minimizing the number of times the function is called?