Difference between revisions of "CSC212 Final Exam 2014"
(Created page with "--~~~~ ---- <onlydft> =Problem #1= * Change the queue in the BFS algorithm with a stack. In general, is the order in which the vertices visited by this new BFS the same as th...") |
|||
Line 27: | Line 27: | ||
(true) | (true) | ||
=Problem #6= | =Problem #6= | ||
− | + | * We cannot create a BST of nodes containing strings, because the string's hash function generates an index that is not related to the alphabetical order of the string. For example, "Alpha" has a hashCode of 63357246, "Bravo " a hashCode of 1997811958, and "Claro" a hashCode of 65190197. | |
+ | * True or False | ||
+ | :(answer false) | ||
+ | =Problem #7= | ||
+ | * If we visit a BST using BFS, the nodes will get visited in order (either increasing or decreasing). True or False | ||
+ | :(answer: False) | ||
+ | =Problem #8= | ||
+ | * | ||
</onlydft> | </onlydft> |