trie_search 1.0.0 copy "trie_search: ^1.0.0" to clipboard
trie_search: ^1.0.0 copied to clipboard

A special data structure used to store strings that can be visualized like a graph.

1.0.0 #

Added #

  • Trie Data Structure:
    • Initial implementation of the Trie data structure.
    • Supports insertion of words and associated details.
    • Allows searching by prefix to retrieve all words starting with a given prefix.
    • Includes a clear method to reset the Trie by deleting all stored data.

Tests #

  • The following test cases have been implemented to ensure the functionality of the Trie class:
    • Search with Substring: Verifies that searching with a single character returns the correct user.
    • Search with Prefix Matching Multiple Users: Ensures that multiple users with the same prefix are correctly returned.
    • Search with Non-Matching Prefix: Ensures that a non-matching prefix returns an empty result.
    • Search with Invalid Input: Tests the Trie with invalid input (e.g., "0") to ensure it returns empty.
    • Multiple Matches: Verifies that all matching entries are returned when there are multiple matches for a prefix.
    • Search in Empty Trie: Verifies that searching in an empty Trie returns an empty result.
    • Duplicate Data Insertion: Ensures that adding duplicate data does not create duplicates in the Trie.
    • Stress Test: Performs a stress test with 1,000,000 entries to compare the performance and memory usage of the Trie against a list-based search.
    • Performance Comparison: Compares the time taken for Trie-based prefix search against a list-based search for large datasets.
12
likes
160
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

A special data structure used to store strings that can be visualized like a graph.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on trie_search