Guidelines:
1. All the questions should be answered strictly using C.
2. Request you not to use Google or any other reference books for solving this paper.
3. Please attach this PDF file along with answers & share it back within 24 hours from receipt of this paper.
The Problem:
Consider that you have been provided with two files.
[Link] : new line separated keywords
[Link] : words that need to be checked against the keywords.
What we need to do is search for the words present in [Link] and check if they are from the set of
valid keywords (given in [Link])
How this needs to be done:
1. Read the file [Link] and create a binary search tree out of it with every node of the tree
containing a valid keyword.
2. Spawn 100 threads that will split up the file [Link] into separate sections and take care of
the words they are responsible for.
3. Generate the result which is a map of every word in [Link] to a TRUE/FALSE value based
on whether it was found or not.
Example:
If the file [Link] contained the following words, the BST would look like the one to the right:
Judy
Bill
Mary
Fred
Alice
Dave
Jane
Tom
Joe
Consider that [Link] contains 1000 words. Each thread would be responsible for processing 10
words each.
If the file [Link] contained the following text:
Alice
Dave
Drake
Mary
Jude
Bill
Francis
Jane
Tom
The expected output would be as following:
Alice : TRUE
Dave : TRUE
Drake : FALSE
Mary : TRUE
Jude : FALSE
Bill : TRUE
Francis : FALSE
Jane : TRUE
Tom : TRUE