Skip to content
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

How to update SortedStringTrie #7

Open
KienPM opened this issue Jan 9, 2020 · 0 comments
Open

How to update SortedStringTrie #7

KienPM opened this issue Jan 9, 2020 · 0 comments

Comments

@KienPM
Copy link

KienPM commented Jan 9, 2020

Can you please tell me if there is any way to update SortedStringTrie and get sorted items after update.
I have a SortedStringTrie trie, I query with a preffix

trie.items('soạn văn lớp 7 bài c')

Output is

[('soạn văn lớp 7 bài chuẩn mực sử dụng từ', 47.6), ('soạn văn lớp 7 bài chơi chữ', 45.8)]

Then I update the trie

trie.__setitem__('soạn văn lớp 7 bài chơi chữ', 51.5)
trie.__setitem__('soạn văn lớp 7 bài cv', 50)

The output is not sorted

[('soạn văn lớp 7 bài chuẩn mực sử dụng từ', 47.6), ('soạn văn lớp 7 bài chơi chữ', 51.5), ('soạn văn lớp 7 bài cv', 50)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant