pydatastructs icon indicating copy to clipboard operation
pydatastructs copied to clipboard

New Features To The Trie Class

Open asmit27rai opened this issue 9 months ago • 1 comments

Add New Features to the Trie Class

Description

The current Trie class provides basic functionality for inserting, deleting, and searching for strings. However, it lacks several useful features that could make it more versatile and powerful. This issue proposes adding the following new features to the Trie class:

  1. Count of Words in the Trie: A method to count the total number of words inserted into the trie.
  2. Longest Common Prefix: A method to find the longest common prefix among all the words in the trie.
  3. Autocomplete: A method to provide autocomplete suggestions based on a given prefix.
  4. Bulk Insert: A method to insert multiple words at once.
  5. Clear Trie: A method to clear the entire trie, removing all words.
  6. Check if Trie is Empty: A method to check if the trie is empty.
  7. Find All Words: A method to retrieve all words stored in the trie.
  8. Find the Shortest Unique Prefix: A method to find the shortest unique prefix for each word in the trie.
  9. Check if Any Word Starts with a Given Prefix: A method to check if any word in the trie starts with a given prefix.
  10. Find the Longest Word in the Trie: A method to find the longest word stored in the trie.

asmit27rai avatar Mar 10 '25 05:03 asmit27rai

I want to work on this issue.

PR is opened for this issue by me.. But you can raise if you want

asmit27rai avatar Mar 10 '25 14:03 asmit27rai