Data structures: Find the anagrams for all words in a list #1

Closed
opened 2024-08-22 13:21:00 +02:00 by pietro · 0 comments
Owner
  • You are given an English dictionary containing M words (“the dictionary”), and a separate list of N words (“the input”, saved in the file words_to_search.txt)
  • For each word in the input, find all the anagrams in the dictionary (e.g., for input 'acme' the anagrams are ['acme', 'came', 'mace']).

How to proceed?

  • Open the notebook at exercises/anagrams/anagrams.ipynb
  • Write an algorithm to find all anagrams for one input word first
  • What is the Big-O class of this algorithm when executed the full N-words input?
  • Is there a way to pre-process the dictionary to improve the Big-O performance?
- You are given an English dictionary containing M words (“the dictionary”), and a separate list of N words (“the input”, saved in the file `words_to_search.txt`) - For each word in the input, find all the anagrams in the dictionary (e.g., for input 'acme' the anagrams are ['acme', 'came', 'mace']). How to proceed? - Open the notebook at `exercises/anagrams/anagrams.ipynb` - Write an algorithm to find all anagrams for one input word first - What is the Big-O class of this algorithm when executed the full N-words input? - Is there a way to pre-process the dictionary to improve the Big-O performance?
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: ASPP/2024-heraklion-data#1
No description provided.