What will be the time complexity of update query operation in an array of size n when we use square root optimization?
What will be the time complexity of update query operation in an array of size n when we use square root optimization? Correct Answer O(1)
The time complexity of query operation remains the same in both square root optimized code and non optimized code. We simply find the chunk in which the update requires to be performed and then add the new updated value at the desired index.
মোঃ আরিফুল ইসলাম
Feb 20, 2025