1. You have a binary tree with n elements that is not in sorted order. What is the time complexity to find the smallest value?


2. what is the worst case time complexity for binary search on an array with n elements?
------------
Okey my answer is

for the first question it would be n(longn), cuz u will have to sort it first.

and the second qustion yes it is log n

please help with explanation
thanx

one more

3- You have a sorted linked list and a BST with n elements each. Which will be faster to traverse?
(print all elements in sorted order)...Explain!

no ideas how to solve this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.