Does comparing string representation of dates in a binary tree implementation offer any advantages over comparing dates directly?

48 views Asked by At

Does lexical comparation of Dates (or DateTimes) offer any advantages when constructing Binary Search Trees over direct comparation of Dates (or DateTimes) when constructing the tree using the date as a key? The newer dates will always follow after the dates that were already added, which would result in a degenerate tree when comparing the dates. I would like to know if using a lexical comparation of the string representation of the date will help with this issue.

P.S. If this question is not appropriate for SO, please comment, I will remove it.

0

There are 0 answers