jeff1evesque / interview-twitter

Least Common Ancestor
2 stars 0 forks source link

alternative input for LCA application #9

Open jeff1evesque opened 10 years ago

jeff1evesque commented 10 years ago

provide an alternative that allows users to decide whether to interactively input values, or to use input.txt

jeff1evesque commented 10 years ago

e04304b: We detect if the user is using python 3.x, or greater -- if so, then use the input(), otherwise, we use the raw_input() to acquire user input.

jeff1evesque commented 10 years ago

c1b5e83: tuples are considered faster than lists:

http://stackoverflow.com/questions/3340539/why-tuple-is-faster-than-list

And, since our variable doesn't contain keys, dictionaries are not needed.

jeff1evesque commented 10 years ago

ccb5245: still need to initialize data_tree as a list within the file least_common_ancestor.py

jeff1evesque commented 10 years ago

898deb6: takes the user inputted values and defines the binary search tree root value, and the remaining node values.

Now, we must prompt the user for two node values in order to determine the least-common-ancestor.