INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014
Any Questions??? PA2
More Hints Draw on paper, try adding 5 titles to your trie on paper Test set = {hello, hello me, hello world, help, zoo} Draw this! (see me after class if you’re not sure yours is right) Binary Tree (CS 143) Trie = Binary tree + n child nodes
More Hints Your Trie class needs 2 functions AddTitle => insert title into trie SearchForPrefix => pass in “hello” => returns “hello, hello me, hello world” in test set Use the debugger!!! Step through each line of code, draw the trie that your code generated, compare it to your ‘theoretical trie’
More Hints Prefix search Traverse trie with letters keyed in ex: “steve jo” Then at the “o” node, try all paths till we find 10 suggestions
More Hints End product Recall “GetNumbersThatStartsWith” quiz PA2 = quiz + trie!!! Instead of searching/returning numbers => do it on strings! .StartsWith = too slow => that’s why we need a trie End product Great Experience! It will be fast, feels like Google.
Use the Discussion Forum!!!
Run out of Memory? Out of memory? Fit as much as possible Preprocess file I will only be typing in English Chars (not even digits) Think about what should be removed to provide the best user experience.
Wikipedia Data Figure out what _ means in Wikipedia Don’t store the first line “page_title” Remove any page with non-(a-zA-Z<space>) Use Large Text File viewer, scan through the document (10min) and understand the data http://www.swiftgear.com/ltfviewer/features.html
Questions?