Is there an algorithm that with a given 2-3 tree T and a pointer to some node v in said tree, the algo can change the key of the node v so T would remain a legal 2-3 tree, in O(logn/loglogn) amortized efficiency?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No.
Assume it was possible, with the algorithm f, we will show we can sort an array with
O(n*logn/loglogn)time complexity.correctness:
After each activation of
fthe tree is legal. After finishing activatingfon all elements ofTand all elements ofA, the tree is legal and contains all elements. Thus, extracting elements from A, we get back the sorted array.complexity:
(1)Creating a tree [no importance which keys we put] is
O(n)we can put0in all elements, it doesn’t matter(2)iterating
Tand creatingBisO(n)(3)activating
fisO(logn/loglogn), thus invoking itntimes isO(n*logn/loglogn)(4) extracting elements is just a traversal:
O(n)Thus: total complexity is
O(n*logn/loglogn)But sorting is an
Omega(nlogn)problem with comparisons based algorithms. contradiction.Conclusion: desired
fdoesn’t exist.