Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 525969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:43:38+00:00 2026-05-13T08:43:38+00:00

I am looking for an algorithm, hint or any source code that can solve

  • 0

I am looking for an algorithm, hint or any source code that can solve my following problem.

I have a folder it contains many text files. I read them and store all text in STRING. Now I want to to calculate, if any of the word appeared in other files or no. ( I know its not clear let me give an example)

For example i have two documents:
Doc A => “brown fox jump”
Doc B => “dog not jump”
Doc C = > “fox jump dog”

Lets say my program read the first document and now first word is “brown” now my program will check if this word is also appeared in any other document? So the answer would be 0. Now it will check again for 2nd word “fox”, it will give output that yes it appeared in (Doc C) so on……
Now it will read Doc B and it will check if dog appeared in other document? Answer would be (Doc C) so on….

Any advice or pseudo code?

Hint: It is also called inverse document frequency ( Idf ). I know what is idf.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:43:39+00:00Added an answer on May 13, 2026 at 8:43 am

    Like GregS said, use HashMap. I’m not posting any code, because I think this is a homework and I want to give to you the opportunity to create it on your own, but the outline is:

    1. Open new document
    2. For every word, look at your hashmap if it’s already there. If it isn’t, create a new key in HashMap with this word, and in that position add the new document (the filename). If it is, just add the filename of the document.

    For example, if you have:
    DocA: Brown fox jump
    DocB: Fox jump dog

    You would open DocA and traverse its contents. ‘brown’ is not in your hashmap, so you would add a new element with key ‘brown’ and value ‘DocA’. The same with ‘fox’ and ‘jump’.
    Then you would open DocB. ‘fox’ is already in your hashmap, so you would add to its value DocB, (the value would be ‘DocA DocB’). Maybe using an ArrayList (in Java) would help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can use the instance variable @controller to get a… May 16, 2026 at 1:56 pm
  • Editorial Team
    Editorial Team added an answer Use the built in function enumerate. for index, name in… May 16, 2026 at 1:56 pm
  • Editorial Team
    Editorial Team added an answer The function you are looking for is ini_get... echo ini_get('session.gc_maxlifetime'); May 16, 2026 at 1:56 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have the same problem as : Can SHA-1 algorithm be computed on a
I'm looking into developing an application that will process data from a line-scan camera
I am looking for a general algorithm to help in situations with similar constraints
I'm facing a what-am-I-looking-for problem again. I've got tracking data, meaning I tracked myself
Looking for a open source mature ASP.NET based blog engine which supports themes. I
Looking at posts like this and others, it seems that the correct way to
I'm looking for a good way to antialias a bitmap i'm generating with actionscript3.
Intro: EDIT: See solution at the bottom of this question (c++) I have a
I'm having trouble getting my head around algorithm analysis. I seem to be okay
I have an hour selection drop down 0-23 and minutes selection drop down 0-59

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.