-
Notifications
You must be signed in to change notification settings - Fork 19.9k
feat: enhance Trie data structure with added methods and tests #5538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…all ascii characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5538 +/- ##
============================================
+ Coverage 58.08% 58.12% +0.04%
- Complexity 3669 3676 +7
============================================
Files 546 546
Lines 15776 15796 +20
Branches 3000 3006 +6
============================================
+ Hits 9164 9182 +18
Misses 6224 6224
- Partials 388 390 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove main
and add JUnit tests
- Rename TrieImp Class to Trie - Add countWords, startsWithPrefix, countWordsWithPrefix methods - Add test cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
TrieImp.java
toTrie.java
to be more inclined with the naming conventionTrieNode
class from being an Inner Class to separate class with inTrie.java
TrieNode
array in children, to incorporate all character values instead if lowercase english alphabets.countWords
,startsWithPrefix
andcountWordsWithPrefix
methods to enhanceTrie
capability.Trie
methods.clang-format -i --style=file path/to/your/file.java