Implement a data structure to store how often each word


Project Assignment

Description:

When you enter a query in a web search engine, it is not really the web that is searched, but a database of statistics about web pages. Collecting those statistics is called "indexing" the web pages, which is done before the actual searches that people perform. In this project, you will implement a data structure to store how often each word occurs in a document, which is one of the most important statistics to gather about web pages. In the next project, you will use this functionality to index several web pages as part of a simple web search engine.

The method needs to be complete:

char* indexPage(const char* url){

//get the words from the site and fill a buffer
//I suggest using fgets and fseek.
//warning you will have to allocate the buffer memory as this function
//should return a new char* reference memory address.
//How you accomplish this end goal is entirely up to your implementation tastes.

char *buff= (char*) malloc(sizeof(char));
char *words;
}

void printTrieContents(node* tNode)
{

//this method should print each word along with its occurrence count.
//I suggest making a nested while system which loops
//through the inner while until it hits a leaf,
//breaks out of the inner loop, prints a buffer and the current node's
//count var
//and then resumes the outer loop.
//Note: the middle loop should stop when it hits a null and return to the outermost
//loop.

}

+ I include the reset of the code, so you can have an idea of it.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Implement a data structure to store how often each word
Reference No:- TGS02505195

Now Priced at $40 (50% Discount)

Recommended (93%)

Rated (4.5/5)