What is the time complexity of the Divide and Conquer algorithm for finding theआकार "एन" की एक सरणी में अधिकतम और न्यूनतम तत्वों को खोजने के लिए विभाजन और विजय
What is the time complexity of the Divide and Conquer algorithm for finding the
maximum and minimum elements in an array of size "n"?
आकार "एन" की एक सरणी में अधिकतम और न्यूनतम तत्वों को खोजने के लिए विभाजन और विजय
एल्गोरिथ्म की समय जटिलता क्या है?
Show answerHide answer
Correct answer: (A) O(n)ओ (एन)
Explanation
The divide-and-conquer max-min algorithm makes about 3n/2 - 2 comparisons (T(n) = 2T(n/2) + 2), which is O(n).Divide-and-conquer max-min एल्गोरिदम लगभग 3n/2 - 2 तुलनाएँ करता है (T(n) = 2T(n/2) + 2), जो O(n) है।