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 790161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:38:20+00:00 2026-05-14T21:38:20+00:00

Please help me in finding the optimized solutions to these interesting data structure questions:

  • 0

Please help me in finding the optimized solutions to these interesting data structure questions:

  1. Given a file containing approx 10 million words, design a data structure for finding the anagrams
  2. Write a program to display the ten most frequent words in a file such that your program be efficient in all complexity measures.
  3. You have a file with millions of lines of data. Only two lines are identical; the rest are all unique. Each line is so long that it may not even fit in the memory. What is the most efficient solution for finding the identical lines?

Adding some more questions:

4) (asked by MS) You are given an array of Strings of length 3. One of the string in the array is marked as Start string and another one as End string. You have to convert start string to end string, given the condition that the intermediate string which you will make should differ from its previous string by only one character and the string should be present in the input array.
eg. If input is

Array: {"fat", "tab", "eat", "see", "tub", "fab", "rat", "sel"}
Start: "fat"
End: "tub"
Then the output should be 
fat -> fab -> tab -> tub

I had tried to solve the third one and had come up with two possible appraoches:
1) Read only the first word of all the lines and then eliminate all those lines whose first word does not match the first word of any other line. Keep getting the successive words of the remaining lines in this manner until you are left with just two lines. You got your answer!
2) Convert each line into a smaller representation. This can be achieved by coding each word in short binary form and then XORing the bits representing each line.

Edit: I now have a good collection of data-structure problems with me, if anyone is interested in discussing them here, then I can post some more.

  • 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-14T21:38:21+00:00Added an answer on May 14, 2026 at 9:38 pm

    The solution which I proposed for the 4th question was to make a graph of all the words in the array.
    First create an adjacency matrix which will have a value 1 if a word can be directly converted to another word.

    Now use depth first search to find a path from Start string to End string and return the path if found.

    Note that you will have to modify the depth first search here to store the path which you have traversed till now. For this, instead of pushing the node which is being visited to Stack, I pushed the complete path till now to the stack, so that when the element is found, I have the complete path from the Start string to the End string.

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

Sidebar

Related Questions

please help me to identify which of these following is more optimized code? for(int
Can any please help me in finding all the file extensions that are natively
Please Help me in finding address from given lat long in android. As I
Please help me finding where I have made mistake? delimiter // CREATE FUNCTION `count_photos_in_gallery`(`tmp_gallery_id`
please help me arrange these 3 buttons horizontally like this photoshopped image: Please take
Can anyone please help in finding the solution of the above question I have
Please help me in finding the syntax error, i have tried my best to
Can anybody please help me finding any good tutorial/sample code about integrating Spring3-MVC and
Could you please help me with finding a problem in the following code (code
Can anyone please help me in finding good tutorials for php/jquery/ajax form submission validating

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.