I don't think you should sort, should u? the problem is to find the longest sequence of consecutive elements in the given array right?
On Mar 28, 6:07 am, Kunal Patil <kp101...@gmail.com> wrote: > @Bittu: > Can you elaborate more how Constructing BST (I hope it stands for Binary > Search Tree) would be o(n)... > I think It would also be O(nlog(n))... > My xplanation: > Single element can be inserted in BST in O(log n) > So inserting n elements would be n * O(log n) --> O(n log n) .... > > So as per me your solution is also not correct... > correct me if I'm wrong somewhere !!! -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.