Question

3b) [4 pts]+ As in the Little SearchEngine assignment, consider a hash table that stores frequencies (number of occurrences)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans for Qn 3b):

Let, the set of words we have W = (w1,w2,.....,w50) for which we have to find the document names.

We have the hash table that stores the frequencies of each individual word in a set of documents, where each entry in the hash table contains the pair of (word frequency, document name) pair.

We have to find the document list for all the words given in the set.

Step 1: Take an empty hash set(set size = number of documents) where the key is the document name.

Step 2: For each word in the given word set (50 words), steps 3 to 5 will be executed.

Step 3: Search for that particular word in the given hash table.

Step 4: If the occurance of that word >=f, then remember all the corresponding document name(s) present in the array list associated with that word in the given hash table. (Suppose if any word is present in two documents but it is present for >=f times only in one document, then consider that document only from the list.)

Step 5: Try to insert all the document name(s) in the new hash set. If the particular position is not empty (i.e. if that specific document name is already present in the hash set, then that entry is full and the document name can't be inserted twice), then skip the document name, otherwise enter the name into the hash set accordingly.

Step 6: Iteration for the 50 words ends here.

Step 7: The required result will be stored in the newly created hash set.

Step :

Add a comment
Know the answer?
Add Answer to:
3b) [4 pts]+ As in the Little SearchEngine assignment, consider a hash table that stores frequencies...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a spell checker that stores a set of words, W, in a hash table and...

    Write a spell checker that stores a set of words, W, in a hash table and implements a function, spellCheck(s), which performs a spell check on the string s with respect to the set of words, W. If s is in W, then the call to spellCheck(s) returns an iterable collection that contains only s, because it is assumed to be spelled correctly in this case. Otherwise, if s is not in W, then the call to spellCheck(s) returns a...

  • Overview: The goal of this assignment is to implement a simple spell checker using a hash...

    Overview: The goal of this assignment is to implement a simple spell checker using a hash table. You will be given the basic guidelines for your implementation, but other than that you are free to determine and implement the exact classes and methods that you might need. Your spell-checker will be reading from two input files. The first file is a dictionary containing one word per line. The program should read the dictionary and insert the words into a hash...

  • In this assignment, you will explore more on text analysis and an elementary version of sentiment...

    In this assignment, you will explore more on text analysis and an elementary version of sentiment analysis. Sentiment analysis is the process of using a computer program to identify and categorise opinions in a piece of text in order to determine the writer’s attitude towards a particular topic (e.g., news, product, service etc.). The sentiment can be expressed as positive, negative or neutral. Create a Python file called a5.py that will perform text analysis on some text files. You can...

  • C++ Based upon the information provided on Hashing and Hash tables, create a Hash Table to...

    C++ Based upon the information provided on Hashing and Hash tables, create a Hash Table to store the data in the provided file which is a list of colors,ColorList.txt Using the basic algorithm that adds the ASCII values of each letter in the color and then mods by your chosen number of bins. Determine the best size (number of bins) for your hash table that is close to Balanced with an average list length between 12-15 (NOTE: list lengths of...

  • please use Java!! We are storing the inventory for our fruit stand in a hash table....

    please use Java!! We are storing the inventory for our fruit stand in a hash table. The attached file shows all the possible key/fruit combinations that can be inserted into your hash table. These are the real price lookup values for the corresponding fruit. Problem Description In this programming assignment, you will implement a hash table class fruitHash. Your hash table must include the following methods: 1) hashFunction(key) This method takes a key as an argument and returns the address...

  • //I NEED THE PROGRAM IN C LANGUAGE!// QUESTION: I need you to write a program which...

    //I NEED THE PROGRAM IN C LANGUAGE!// QUESTION: I need you to write a program which manipulates text from an input file using the string library. Your program will accept command line arguments for the input and output file names as well as a list of blacklisted words. There are two major features in this programming: 1. Given an input file with text and a list of words, find and replace every use of these blacklisted words with the string...

  • How to write the insert, search, and remove functions for this hash table program? I'm stuck......

    How to write the insert, search, and remove functions for this hash table program? I'm stuck... This program is written in C++ Hash Tables Hash Table Header File Copy and paste the following code into a header file named HashTable.h Please do not alter this file in any way or you may not receive credit for this lab For this lab, you will implement each of the hash table functions whose prototypes are in HashTable.h. Write these functions in a...

  • Please Answer the following: 4. 5. >> How long would each of these operations take in...

    Please Answer the following: 4. 5. >> How long would each of these operations take in Big O notation? 4.5 Printing the value of each element in an array. 4.6 Doubling the value of each element in an array. 4.7 Doubling the value of just the first element in an array. 4.8 Creating a multiplication table with all the elements in the array. So if your array is [2, 3,7, 8, 10], you first multiply every element by 2, then...

  • In this question, we will think about how to answer shortest path problems where we have more than just a single sourc...

    In this question, we will think about how to answer shortest path problems where we have more than just a single source and destination. Answer each of the following in English (not code or pseudocode). Each subpart requires at most a few sentences to answer. Answers significantly longer than required will not receive full credit You are in charge of routing ambulances to emergency calls. You have k ambulances in your fleet that are parked at different locations, and you...

  • Python Programming (Just need the Code) Index.py #Python 3.0 import re import os import collections import...

    Python Programming (Just need the Code) Index.py #Python 3.0 import re import os import collections import time #import other modules as needed class index:    def __init__(self,path):    def buildIndex(self):        #function to read documents from collection, tokenize and build the index with tokens        # implement additional functionality to support methods 1 - 4        #use unique document integer IDs    def exact_query(self, query_terms, k):    #function for exact top K retrieval (method 1)    #Returns...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT