careful, things don't collapse so easily; otherwise we'd always have either O(n) or O(1).
Agreed, it is a constant, as much as traversing a bst is a constant bound above by some fixed value. When determining runtime in big-O, you must always use the upper bound. Now for strings, m would be some f(max_string_length) - which in this example is not likely to be >= n (but in many cases could be and therefore wouldn't be negligible) The two methods are practically the same (I agree my overlooking the compare function in my example wasn't fair) - but the question now becomes, which better suits the target language... NOTE: in m = f(max_string_length) I assume that max_string_length is the main dependancy driving the hash function. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
