00:01
Hello student here, two algorithms are given to us.
00:04
Algorithm x solve the problem by dividing into the 8 subproblems half the size.
00:10
So these two algorithms follow the divide and conquer approach.
00:13
So recursively solving each subproblem and then combining the solution to a constant time.
00:17
And algorithm y solve the problem of the size n by dividing into the 7 subproblems of the size n by 3.
00:25
And recursively solve each subproblem and combining the solution in o of n.
00:29
So first is taking the constant time for combining and the second one is taking the n time.
00:35
So write a recursive relation of each of the above algorithm and there are what are the running time for each of these algorithm in asymptotic notation and which algorithm which is.
00:45
So here to analyze the running time of the two algorithm based on divide and conquer technology, we will first establish the recursive relation for each of the algorithm and determine the asymptotic running time.
00:55
So first i'm taking the algorithm x as according to problem algorithm x is dividing the problem into 8 subproblem of half the sizes.
01:03
So n by 2 is the size and then combine the solution in the constant time.
01:07
So i can write the recursive relation as t underscore x over here.
01:13
I can write simple in this way also x i have taken because it's algorithm x and this is the t and here i can write this also t n by 2 plus constant time 1 but for clarity i have taken t underscore x because i am working for the x algorithm here.
01:34
So t underscore x represent the time complexity of the algorithm x for a problem of the size n which is given to us the algorithm recursively solve 8 subproblem.
01:43
So here it is recursion the problem in recursion the function call by itself.
01:50
So name of the function is t and it's calling again and again it is it's dividing the problem into the size n by 2 and combining the solution in constant time.
02:00
So for the constant time we write this equation for the algorithm y.
02:05
Now i have to deal with the algorithm y for which i have to write the recursive relation.
02:11
So for the algorithm y as we know it is given to us that for the algorithm y the problem this is dividing the problem into the 7 subproblem and the size n by 3 and earlier x algorithm was dividing the problem into 8 but the size was n by 2 here and by 3 and the combining time is o n and in the x algorithm it was taking the constant time.
02:35
The recursive relation can be expressed here...