Design and analyze an algorithm that searchs for an element x in a sorted table A(with n elements), so that its complexity is O(logD). D stands for distance, counting the amount of elements between the first element and the element x in table A. Simpler, D is the position of the element x in the sorted table A.
All 3 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.