22
loading...
This website collects cookies to deliver better user experience
Implementing an autocomplete that, based on a user’s input, returns a list of possible categories based on the beginning of a word. You should use the data created in the last step to create the autocomplete. It is up to you how to properly store and retrieve the data.
Retrieving and displaying all of the data related to the category selected by the user. It is up to you how to properly store and retrieve the data.
studios.py
. This will randomly generate random studios and classes which will be inserted into a binary search tree (BST). The resulting tree is pickled, ready for the next step.script.py
. The program will prompt for both the activities the user is looking for, and the timing for said classes. The program's final payload is a list of classes from the database (if any) that satisfy the user's above conditions. studios.py
is run, random classes will be generated for 22 fictional studios. The studios already have a set of possible classes and the associated tags for said classes. Each class's timing, price, and instructor, however, is randomly generated each time. O(n)
, where n is the number of tags in the data structure. Look for the smallest term that is greater than or equal to the search term.
Traverse the tree for the next largest key until the search term no longer matches the relevant part of the search term (ie node.key[:len(search_term)]
).
Return the list of nodes that contain these keys.
O(log(n) + t)
, where n
is the number of nodes in the tree and t
is the number of nodes that contain the search term.