instead of using lists in the table slotswe could use another structure that allows for fast searching we have already looked at binary search trees (bstswe could simply put an (initially emptybst in each slotslot holds bst which we search for the key but we would still have potential problemdepending on the order in which the items were added to the bstwe could end up with search tree that is as inefficient as list that iseach node in the tree has exactly one child to avoid thiswe would need to ensure that our bst is self-balancing symbol tables symbol tables are used by compilers and interpreters to keep track of the symbols that have been declared and information about them symbol tables are often built using hash tablessince it is important to efficiently retrieve symbol in the table let us look at an example suppose we have the following python codename "joeage here we have two symbolsname and age they belong to namespacewhich could be __main__but it could also be the name of module if you placed it there each symbol has valuename has the value joe and age has the value symbol table allows the compiler or the interpreter to look these values up the symbols name and age become the keys in our hash table all the other information associated with itsuch as the valuebecome part of the value of the symbol table entry not only variables are symbolsbut functions and classes as well they will all be added to our symbol tableso that when any one of them needs to be accessedthey are accessible from the symbol table