vue - Tries
Commentaires
-
I have this scenario in c# I use a textbox to enter a string and search for this string through a file, this file contains lines of strings; each line consists of an integer, a delimiter, and a text which I want to display if it's prefix matches the entered text. for example: the text box contains the string "How to f" the file I want to search from contains the following: "14;How to do maths 12;How to fruit 18;How to find mangos in jungle" and I'm supposed to display "How to find mangos in jungle" in a line and the next line is "How to fruit" I am aware of a function in c# that does does the prefix search, but didn't consider the integer (the weight)... I am supposed to display the results sorted by their weights (descending). This is my first time so you probably find this vague, any help is appreciated.
-
lol - Reading title
First thought: "Tries" like from "try" O_o?!
Second: "Tries" from "tree" Facepalm -
well explained .
-
So far the best one at cs50 videos, everyone else is fake-smiling and reading from a script, you actually know what you're talking about.
-
Someone should've told Indiana Jones about tries, he didn't need to search for the Holy Grail at all
-
You guys are amazing!!
-
Same question as the others below; what if you have the same key twice. Next question, it's not obvious as to why a Trie structure is any better than a sparsely populated array. Also wondering, why do you use specifically 10 nodes per Trie - is it because there are only 10 unique digits? So, if your key was a String, you would use 26 Nodes/Trie? Also, there is no hashing necessary anywhere here, correct?
-
This was brilliantly explained!
-
You are an amazing mentor. Be proud of yourself!
-
This is certainly no "Holy Grail" of data structures, notably you still have collisions. So improvements can still be made.
-
what happens if we want to insert two different elements that have the same key?
-
What if another Univ I wanted to add in this TRIE was also founded in 1636 ?
-
Hi I have a question! What if in your trie, there are multiple items with the same "identification code" (so to speak) for you to insert? For example -- what if Harvard wasn't the only university founded in 1636, and you wanted to include some other hypothetical university into your data structure too? Would "Harvard" have to be excluded from the structure, to be replaced by the new item? What if you wanted to include both items in the trie? Would you have to allocate more memory? How would it be implemented?
-
Well explained thanks!!, can we see what it looks like in a program?
-
Masterly lesson on tries!
Évaluation