|
UNIT –
1 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Unit-01/Lecture-01 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Introduction to Algorithms, Designing algorithms |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Algorithm: An algorithm is any set of detailed instructions which
results in a predictable end-state from a known beginning. Algorithms are
only as good as the instructions given, however, and the result will be
incorrect if the algorithm is not properly defined. Algorithms are used for
calculation, data processing, and automated reasoning.
Fig
1.1.1:Algorithm Classification: Ø On the Basis of Implementation
Serial
Algorithm: A sequential algorithm or serial algorithm is an algorithm
that is executed sequentially – once through, from start to finish, without
other processing executing. Parallel
Algorithm: A parallel algorithm is an algorithm which can be executed
a piece at a time on many different processing devices, and then combined
together again at the end to get the correct result. Distributed
Algorithm: A distributed algorithm is an algorithm designed to run on
computer hardware constructed from interconnected processors. Distributed
algorithms are used in many varied application areas of distributed
computing, such as telecommunications, scientific computing, distributed
information processing, and real-time process control.
Recursive
Algorithm: A recursive
algorithm is an algorithm which calls itself with "smaller (or
simpler)" input values, and which obtains the result for the current
input by applying simple operations to the returned value for the smaller (or
simpler) input. Iterative
Algorithm: An iterative algorithm executes steps in iterations. It
aims to find successive approximation in sequence to reach a solution. They
are most commonly used in linear programs where large numbers of variables
are involved.
Deterministic
Algorithm: A deterministic algorithm is an algorithm which, given a
particular input, will always produce the same output, with the underlying
machine always passing through the same sequence of states. Non-Deterministic
Algorithm: A nondeterministic algorithm is an algorithm that, even for
the same input, can exhibit different behaviours on different runs, as
opposed to a deterministic algorithm. Exact or approximate Ø On the Basis of Design
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Unit-01/Lecture-02 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Analyzing algorithms & Asymptotic Notation |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Why Analyze an
Algorithm? The most straightforward reason for analyzing an algorithm is to
discover its characteristics in order to evaluate its suitability for various
applications or compare it with other algorithms for the same application.
Moreover, the analysis of an algorithm can help us understand it better, and
can suggest informed improvements. Algorithms tend to become shorter,
simpler, and more elegant during the analysis process. Computational
Complexity: The branch of theoretical computer science where the goal is to
classify algorithms according to their efficiency and computational problems
according to their inherent difficulty is known as computational complexity.
Paradoxically, such classifications are typically not useful for predicting
performance or for comparing algorithms in practical applications because
they focus on order-of-growth worst-case performance. In this book, we focus
on analyses that can be used to predict performance and compare algorithms. Analysis of
Algorithms: A complete analysis of the running time of an algorithm involves the
following steps:
Complexity of An Algorithm: Time Complexity: The time complexity of an
algorithm quantifies the amount of time taken by an algorithm to run. It is
commonly estimated by counting the number of elementary operations performed
by the algorithm, where an elementary operation takes a fixed amount of time
to perform. Space Complexity: This is essentially the number of
memory cells which an algorithm needs to run. A good algorithm keeps this number
as small as possible. There is often a time-space
trade-off involved in a problem, that is, it cannot be solved with few
computing time and low memory consumption. One then has to make a compromise
and to exchange computing time for memory consumption or vice versa,
depending on which algorithm one chooses and how one parameterizes it. Amortized analysis: Sometimes we find the statement
in the manual that an operation takes amortized time O(f(n)). This means that
the total time for n such operations is bounded asymptotically from above by
a function g(n) and that f(n)=O(g(n)/n). So the amortized time is (a bound
for) the average time of an operation in the worst case. Step Count: •
s/e is the
number of steps per execution of the statement. •
Frequency is
how often each statement is executed. •
The time
complexity is estimated as Total steps.
Table 1.2.1: Step Count of Sequential Search Worst-case complexity: The
worst-case complexity of the algorithm is the function defined by the maximum
number of steps taken on any instance of size n. It represents the curve
passing through the highest point of each column. Best-case complexity: The
best-case complexity of the algorithm is the function defined by the minimum
number of steps taken on any instance of size n. It represents the curve
passing through the lowest point of each column. Average-case complexity: The
average-case complexity of the algorithm is the function defined by the
average number of steps taken on any instance of size n. Asymptotic Notations: The goal of computational
complexity is to classify algorithms according to their performances. Definition of "big Oh" For any monotonic functions f(n)
and g(n) from the positive integers to the positive integers, we say that
f(n) = O(g(n)) when there exist constants c > 0 and n0 > 0 such that f(n) ≤ c * g(n), for all n ≥ n0 Intuitively, this means that
function f(n) does not grow faster than g(n), or that function g(n) is an
upper bound for f(n), for all sufficiently large n→∞ Here is a graphic representation
of f(n) = O(g(n)) relation:
Fig
1.2.1: Graph of Big Oh Notation Examples: Constant Time: O(1) Linear Time: O(n) Logarithmic Time: O(log n) Quadratic Time: O(n2) Definition of "big Omega": We need the notation for the
lower bound. A capital omega Ω notation is used in this case. We say
that f(n) = Ω(g(n)) when there exist constant c that f(n) ≥ c*g(n)
for for all sufficiently large n. Examples Constant Time: Ω(1) Linear Time: Ω(n) Logarithmic Time: Ω(log n) Quadratic Time: Ω(n2) Definition of "big Theta": To measure the complexity of a
particular algorithm, means to find the upper and lower bounds. A new
notation is used in this case. We say that f(n) = Θ(g(n)) if and only
f(n) = O(g(n)) and f(n) = Ω(g(n)). Examples Constant Time: Θ(1) Linear Time: Θ(n) Logarithmic Time: Θ(log n) Quadratic Time: Θ(n2)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Unit-01/Lecture-03 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Heap and Heap Sort |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Heap definition:
A heap is a complete binary tree with the property that the value at each
node is at least as large as the values at its children. This definition
implies that a largest element is at the root of the heap. If the elements
are distinct, then the root contains the largest item. The relation greater
than or equal to may be reversed so that the parent node contains a value as
small as or smaller than its children. In this case the root contains the
smallest element.
Fig
1.3.1: Heap Heap Insertion:
Fig
1.3.2: Heap Insertion Algorithm
Fig
1.3.3: Creating Heap using (40, 80, 35, 90, 45, 50, 70)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Unit-01/Lecture-04 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Introduction to divide and conquer technique |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DIVIDE
AND CONQUER:
·
Given a function to compute on ‘n’ inputs the
divide-and-conquer strategy suggests splitting the inputs into ‘k’ distinct
subsets, 1<k<=n, yielding ‘k’ sub problems. ·
These sub problems must be solved, and then a method must
be found to combine sub solutions into a solution of the whole. ·
If the sub problems are still relatively large, then the
divide-and-conquer strategy can possibly be reapplied. ·
Often the sub problems resulting from a divide-and-conquer
design are of the same type as the original problem. ·
For those cases the re application of the
divide-and-conquer principle is naturally expressed by a recursive algorithm. ·
D And C(Algorithm) is initially invoked as D and C(P),
where ‘p’ is the problem to be solved. ·
Small(P) is a Boolean-valued function that determines
whether the i/p size is small enough that the
answer can be computed without splitting. ·
If this so, the function ‘S’ is invoked. ·
Otherwise, the problem P is divided into smaller sub
problems. ·
These sub problems P1, P2 …Pk are solved by recursive
application of D And C. ·
Combine is a function that determines the solution to p using
the solutions to the ‘k’ sub problems. ·
T(n)= g(n) n small T(n1)+T(n2)+……………+T(nk)+f(n);
otherwise. Where T(n) à is the time for D And C on any I/p of size ‘n’. g(n) à is the time of compute the answer
directly for small I/ps. f(n) à is the time for dividing P &
combining the solution to sub problems. Algorithm
D And C(P) { if small(P) then return S(P); else { divide P into
smaller instances P1, P2… Pk, k>=1; Apply D And C to each of these sub problems; return combine
(D And C(P1), D And C(P2),…….,D And C(Pk));
} }
T(n) =
T(1) n=1 aT(n/b)+f(n) n>1 Ø Where a & b
are known constants. Ø We assume that
T(1) is known & ‘n’ is a power of b(i.e., n=b^k)
Example: 1)
Consider the case in which a=2 and b=2. Let T(1)=2 &
f(n)=n. We
have, T(n)
= 2T(n/2)+n = 2[2T(n/2/2)+n/2]+n = [4T(n/4)+n]+n
= 4T(n/4)+2n = 4[2T(n/4/2)+n/4]+2n = 4[2T(n/8)+n/4]+2n = 8T(n/8)+n+2n = 8T(n/8)+3n * * In general, we
see that T(n)=2^iT(n/2^i )+in., for any log n >=I>=1. Ø T(n) =2^log n
T(n/2^log n) + n log n Ø Corresponding to
the choice of i=log n Ø Thus, T(n) =
2^log n T(n/2^log n) + n log n = n. T(n/n) + n log
n = n. T(1) + n log
n [since, log 1=0, 2^0=1]
= 2n + n log n |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Unit-01/Lecture-05 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comparison of various
algorithms based on technique- Recurrence Relation |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
SOLVING RECURRENCES :-
This approach generally proceeds in 4 stages. 1.
Calculate the first few values of the recurrence 2.
Look for regularity. 3.
Guess a suitable general form. 4.
And finally prove by mathematical induction (perhaps
constructive induction). Then this form
is correct. Consider
the following recurrence,
Q
if n=0 T(n) = 3T(n ÷ 2)+n otherwise
N 1
2 4 8
16 32
* For instance,
T(16) = 3 * T(8) +16 = 3 * 65
+16 = 211. * Instead of writing
T(2) = 5, it is more useful to
write T(2) = 3 * 1 +2. Then, T(A) = 3 *
T(2) +4 =
3 * (3 * 1 +2) +4 =
(32 * 1) + (3 * 2) +4 * We continue in
this way, writing ‘n’ as an explicit power of 2.
N T(n)
1
1 2
3 * 1 +2 22 32
* 1 + 3 * 2 + 22 23 33
* 1 + 32 * 2 + 3 * 22
+ 23 24 34
* 1 + 33 * 2 + 32 * 22 + 3 * 23 +
24 25 35
* 1 + 34 * 2 + 33 * 22 + 32 * 23
+ 3 * 24 + 25
T(2k ) = 3k20 + 3k-121
+ 3k-222+…+312k-1 + 302k.
= ∑ 3k-i 2i
= 3k ∑
(2/3)i
= 3k * [(1 – (2/3)k
+ 1) / (1 – (2/3)]
= 3k+1 – 2k+1 Proposition:
(Geometric Series) Let Sn be the sum of the
first n terms of the geometric series a, ar, ar2….Then
Sn = a(1-rn) / (1-r), except in the special case when r
= 1; when Sn = an. = 3k
* [ (1 – (2/3) k+1) / (1 –
(2/3))] = 3k
* [((3 k+1 – 2 k+1)/ 3 k+1) /
((3 – 2) / 3)]
3 k+1 – 2k+1 3 = 3k
* ----------------- *
---- 3 k+1 1 Q
k+1 – 2k+1 = 3k
* ----------------- 3k+1-1 = 3k+1 –
2k+1 * It is easy to check this formula against our earlier
tabulation.
|
1
T(n) =
3T(n/2) + n
* We replace ‘n’ by 2i.
* This is achieved by introducing new recurrence ti, define by ti
= T(2i)
* This transformation is useful because n/2 becomes (2i)/2
= 2 i-1
* In other words, our original recurrence in which T(n) is
defined as a function of
T(n/2) given way
to one in which ti is defined as a
function of t i-1, precisely
the type of
recurrence we have learned to solve.
Ti
= T(2i) = 3T(2 i-1) + 2i
ti = 3t i-1 + 2i
ti – 3t i-1 = 2i à(A)
In this case,
b = 2, p(n)
= 1, degree = 0
So, the characteristic equation,
(x – 3)(x – 2)
= 0
The roots are, r1 = 3, r2 = 2.
The general equation,
tn = C1 r1i +
C2 r2i
sub. R1
& r2: tn = 3nC1 + C2
2n
tn = C1 3i
+ C2 2i
We use the fact that, T(2i) = ti & thus T(n) = tlogn
when n= 2i to obtain,
T(n) = C1. 3 log2n
+ C2. 2log2n
T(n) =
C1 . nlog23 + C2.n [i = logn]
When ‘n’ is a power of 2, which is sufficient to conclude
that,
T(n)
= O(n log3) ‘n’ is a power
of 2
|
S.NO |
RGPV QUESTIONS |
Year |
Marks |
|
Q.1 |
Solve the following recurrence relation: 1.
T(n) = T(n1/2) + n 2.
If n>=2 otherwise T(n) = 1 |
June-2012 |
7 |
|
Q.2 |
|
|
|
|
|
|
|
|
Unit-01/Lecture-06
Binary search
Binary search:
Binary search
method is also relatively simple method. For this method it is necessary to have
the vector in an alphabetical or numerically increasing order. A search for a
particular item with X resembles the search for a word in the dictionary. The
approximate mid entry is located and its key value is examined. If the mid
value is greater than X, then the list is chopped off at the (mid-1)th location. Now the list gets reduced to half
the original list. The middle entry of the left-reduced list is examined in a
similar manner. This procedure is repeated until the item is found or the
list has no more elements. On the other hand, if the mid value is lesser than
X, then the list is chopped off at (mid+1)th
location. The middle entry of the right-reduced list is examined and the
procedure is continued until desired key is found or the search interval is
exhausted.
Algorithm
Binsearch(a,n,x)
// Given an array a[1:n] of
elements in non-decreasing
//order, n>=0,determine whether
‘x’ is present and
// if so, return ‘j’ such that
x=a[j]; else return 0.
{
low:=1; high:=n;
while (low<=high) do
{
mid:=[(low+high)/2];
if (x<a[mid]) then
high=mid-1;
else if(x>a[mid]) then
low=mid+1;
else return mid;
}
return 0;
}
Example:Let us select the 14 entries.
-15,-6,0,7,9,23,54,82,101,112,125,131,142,151.
à Place them in a[1:14], and
simulate the steps Binsearch goes through as it searches
for different values of ‘x’.
à Only the variables, low, high
& mid need to be traced as we simulate the algorithm.
à We try the following values for x:
151, -14 and 9.
For 2 successful searches &
1 unsuccessful search.
X=151 low high mid
1 14 7
8 14 11
12 14 13
14 14 14
Found
x=-14 low high mid
1 14 7
1 6 3
1 2 1
2 2 2
2 1 Not found
x=9 low high mid
1 14 7
1 6 3
4 6 5
Found
Theorem: Algorithm Binsearch(a,n,x) works correctly.
Proof:
We assume that
all statements work as expected and that comparisons such as x>a[mid] are
appropriately carried out.
Complexity: O(log n)
Unit-01/Lecture-07
Merge sort
MERGE SORT
Algorithm
For Merge Sort:
Algorithm MergeSort(low,high)
//a[low:high]
is a global array to be sorted
//Small(P) is true if there is only
one element
//to sort. In this case the list is
already sorted.
{
if (low<high) then //if there
are more than one element
{
//Divide P into subproblems
//find where to split the set
mid
= [(low+high)/2];
//solve the subproblems.
Mergesort (low,mid);
mergesort(mid+1,high);
//combine the solutions .
merge(low,mid,high);
}
}
(310| 285| 179| 652, 351| 423, 861, 254,
450, 520)
Where
vertical bars indicate the boundaries of sub arrays.
Elements
a[I] and a[2] are merged to yield,
(285,
310|179|652, 351| 423, 861, 254, 450, 520)
Then
a[3] is merged with a[1:2] and
(179,
285, 310| 652, 351| 423, 861, 254, 450, 520)
Next,
elements a[4] & a[5] are merged.
(179,
285, 310| 351, 652 | 423, 861, 254, 450, 520)
And
then a[1:3] & a[4:5]
(179,
285, 310, 351, 652| 423, 861, 254, 450, 520)
Repeated
recursive calls are invoked producing the following sub arrays.
(179,
285, 310, 351, 652| 423| 861| 254| 450, 520)
Elements
a[6] &a[7] are merged.
Then
a[8] is merged with a[6:7]
(179,
285, 310, 351, 652| 254,423, 861| 450, 520)
Next
a[9] &a[10] are merged, and then a[6:8] & a[9:10]
(179,
285, 310, 351, 652| 254, 423, 450, 520, 861 )
At
this point there are 2 sorted sub arrays & the final merge produces the
fully
sorted result.
(179, 254, 285, 310, 351, 423, 450, 520,
652, 861)
Ø When ‘n’ is a
power of 2, n= 2^k, we can solve this equation by successive substitution.
T(n) =2(2T(n/4)
+cn/2) +cn
= 4T(n/4)+2cn
= 4(2T(n/8)+cn/4)+2cn
*
*
= 2^k T(1)+kCn.
= an + cn log n.
Ø It is easy to
see that if s^k<n<=2^k+1, then
T(n)<=T(2^k+1). Therefore,
T(n)=O(n log n)
|
S.NO |
RGPV QUESTIONS |
Year |
Marks |
|
Q.1 |
Explain any one application that can be solved
by divide and conquer. |
Dec-2014 |
3 |
|
Q.2 |
Sort
the given list using merge sort 70, 80, 40, 50, 60, 12, 35, 95, 10. |
June-2014 |
7 |
|
Q.3 |
Define and explain merge sort algorithm. |
JUNE 2015 |
7 |
Unit-01/Lecture-08
Quick sort
QUICK SORT
•
The divide-and-conquer approach can be used to arrive at an
efficient sorting method different from merge sort.
•
In merge sort, the file a[1:n] was divided at its midpoint
into sub arrays which were independently sorted & later merged.
•
In Quick sort, the division into 2 sub arrays is made so
that the sorted sub arrays do not need to be merged later.
•
This is accomplished by rearranging the elements in a[1:n]
such that a[I]<=a[j] for all I between 1 & n and all j between (m+1)
& n for some m, 1<=m<=n.
•
Thus the elements in a[1:m] & a[m+1:n] can be
independently sorted.
•
No merge is needed. This rearranging is referred to as
partitioning.
•
Function partition of Algorithm accomplishes an in-place
partitioning of the elements of a[m:p-1]
•
It is assumed that a[p]>=a[m] and that a[m] is the
partitioning element. If m=1 & p-1=n, then a[n+1] must be defined and
must be greater than or equal to all elements in a[1:n]
•
The assumption that a[m] is the partition element is merely
for convenience, other choices for the partitioning element than the first
item in the set are better in practice.
•
The function interchange (a,I,j)
exchanges a[I] with a[j].
Algorithm:
Partition the array a[m:p-1] about a[m]
Algorithm Partition(a,m,p)
//within
a[m],a[m+1],…..,a[p-1] the elements
//
are rearranged in such a manner that if
//initially
t=a[m],then after completion
//a[q]=t
for some q between m and
//p-1,a[k]<=t
for m<=k<q, and
//a[k]>=t
for q<k<p. Q is returned
//Set
a[p]=infinite.
{
v=a[m];I=m;j=p;
repeat
{
repeat
I=I+1;
until(a[I]>=v);
repeat
j=j-1;
until(a[j]<=v);
if
(I<j) then interchange(a,i.j);
}until(I>=j);
a[m]=a[j];
a[j]=v;
retun j;
}
Algorithm Interchange(a,I,j)
//Exchange
a[I] with a[j]
{
p=a[I];
a[I]=a[j];
a[j]=p;
}
Algorithm:
Sorting by Partitioning
Algorithm Quicksort(p,q)
//Sort
the elements a[p],….a[q] which resides
//is
the global array a[1:n] into ascending
//order;
a[n+1] is considered to be defined
//
and must be >= all the elements in a[1:n]
{
if(p<q)
then // If there are more than one element
{
//
divide p into 2 subproblems
j=partition(a,p,q+1);
//’j’
is the position of the partitioning element.
//solve
the subproblems.
Quicksort(p,j-1);
quicksort(j+1,q);
//There
is no need for combining solution.
}
}
Complexity:
O(n log n)- Best and Average case
O(n2) in
worst case
Example:
As
an example of how PARTITION works consider the following array of 9 elements.
The procedure is initially invoked as call PARTITION (l, 10). The vertical
bars connected by a horizontal line indicate those elements which were interchanged
to produce the next row. A(l) = 65 is the partitioning element and it is
eventually (in the sixth row) determined to be the 5th smallest
element of the set. Notice that the remaining elements are unsorted but they
are partitioned about A(S) = 65.

|
S.NO |
RGPV QUESTIONS |
Year |
Marks |
|
Q.1 |
Explain any one application that can be solved
by divide and conquer. |
Dec-2014 |
3 |
|
Q.2 |
Explain
how to apply the divide and conquer strategy for sorting the elements using
quick sort? |
June-2014 |
3 |
|
Q.3 |
Sort the following
list using quick sort and argue upon iots running
time? A=[5,7,9,4,10,2,8,1] |
DEC 2015 |
7 |
Unit-01/Lecture-9
Strassen’s matrix
multiplication
![]()
![]()
STRASSON’S MATRIX MULTIPLICAION
C (i ,j )= A(i,k) B(k,j) for all ‘i’ and and j between 1 and n.
![]()
![]()
![]()
A11 A12 B11 B12 C11 C12
* =
A21 A21 B21 B22 C21 C22
C11 = A11 B11 +
A12 B21
C12 = A11 B12 +
A12 B22
C21 = A21 B11 +
A22 B21
![]()
![]()
![]()
C22 = A21 B12 +
A22 B22
![]()
![]()
For EX:
2 2 2 2 1
1 1 1
4 * 4 = 2 2 2 2
1
1 1 1
2 2 2 2 * 1
1 1 1
2 2 2 2 1 1 1
1
The Divide and
conquer method
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
2 2
2 2 1 1
1 1 4 4
4 4
2
2 2 2
* 1 1
1 1 = 4
4 4 4
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
2 2
2 2 1 1
1 1 4 4
4 4
2 2
2 2 1
1 1 1 4 4
4 4
T(n)= b
n<=2 a &b are
7T(n/2)+an2 n>2 constant
Finally we get
T(n) =O( nlog27)
since n/2 * n/2 matrix can be can be added in Cn
for some constant C, The overall computing time T(n) of the resulting divide
and conquer algorithm is given by the sequence.
T(n)= b
n<=2 a &b are
8T(n/2)+cn^2 n>2 constant
That is T(n)= O( nlog28)=O(n3)
* Matrix multiplication are more expensive then the matrix
addition O(n^3).We can attempt to reformulate the equation for Cij so as to have fewer multiplication and
possibly more addition .
P= (A11+A12)(B11+B22)
Q= (A12+A22)B11
R= A11(B12-B22)
S= A22(B21-B11)
T= (A11+A12)B22
U= (A21-A11)(B11+B12)
V= (A12-A22)(B21+B22)
C11=P+S-T+V
C12=R+T
C21=Q+T
C22=P+R-Q+V
Example:
![]()
![]()
![]()
4 4
* 4 4
4 4
4 4
P=(4*4)+(4+4)=64
Q=(4+4)4=32
R=4(4-4)=0
S=4(4-4)=0
T=(4+4)4=32
U=(4-4)(4+4)=0
V=(4-4)(4+4)=0
C11=(64+0-32+0)=32
C12=0+32=32
C21=32+0=32
C22=64+0-32+0=32

So the answer c(i,j) is 32
32
32 32
|
S.NO |
RGPV QUESTIONS |
Year |
Marks |
|
Q.1 |
Write down Stassen’s algorithm for
multiplication? |
Dec-2014 |
7 |
|
Q.2 |
Explain
the strassen’s multiplication technique? |
June-2014 |
2 |
|
Q.3 |
Write short note on Strassen’s Matrix multiplication.
Compare it with conventional Divide and Conquer technique of matrix
multiplication. |
Dec-2012 |
7 |
|
Q.4 |
Show how the following matrices would be multiplied using
strrasen’s algorithm |
DEC 2015 |
7 |