ScratchData LogoScratchData
Back to heehee341's profile

trie

HEheehee341•Created May 17, 2024
trie
0
0
4 views
View on Scratch

Instructions

This is a data structure that functions similarly to a set, dictionary, or hash table, but it also has the function "get all", is more memory effecient, and is immune to hash collisions. It can complete the following operations: 1. Add(number): adds a number to the data structure 2. Search(number): searches the data structure to see if the number has been saved. 3. Delete(number): deletes the number from the data structure. 4. Get all(): gets all items in the data structure. Add, Search, and Delete run in O(L) where L is the length in digits of the item being saved. This essentially makes it linear because all inputs will likely be similar length. Get all runs in O(LN) where N is the amount of items saved.

Project Details

Project ID1021785263
CreatedMay 17, 2024
Last ModifiedMay 30, 2024
SharedMay 17, 2024
Visibilityvisible
CommentsAllowed