HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Finding integer square root for large integers [find asymptotic time complexity]

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
findfindingasymptotictimelargeforrootsquareintegersinteger

Problem

So I found this tasks in one book I am practicing from where it says:
"Find a divide-and-conquer algorithm for finding square roots for large integers and along this, find its asymptotic time complexity". Results can be in integer range.
I am not sure which algorithm should I use, but I started with recursive method where I count the medium between two borders and go on until i find the perfect score, or if begin border becomes greater than the end one. What I have problem here is how to measure complexity for this problem and I am not even sure does this method count as divide-and-conquer?

Solution

Normally, you don't measure the complexity of a problem before designing an algorithm; instead, you measure the complexity of a particular algorithm. So, before you get to measuring complexity, the first step is to come up with a specific algorithm.

When you have a specific algorithm in mind, one technique that's useful for analyzing the running time of divide-and-conquer algorithms is to write down a recurrence relation characterizing its running time, and then solve the recurrence. You can often use the Master theorem to solve the recurrence.

To learn these techniques, see your favorite algorithms textbook, or read the following resources:

  • How to come up with the runtime of algorithms?



  • What is the difference between an algorithm, a language and a problem?



  • Solving or approximating recurrence relations for sequences of numbers



  • Is there a system behind the magic of algorithm analysis?

Context

StackExchange Computer Science Q#60932, answer score: 3

Revisions (0)

No revisions yet.