-->
当前位置:首页 > 题库

单选题:Givien two $$n\times n$$ matrices $$A$$ and $$B$$. Let's consid

Luz5年前 (2021-05-10)题库887
Givien two $$n\times n$$ matrices $$A$$ and $$B$$. Let's consider the following Divide and Conquer idea to do matrix multiplication $$C = A \cdot B$$.

Divide each matrix into four $$\frac{n}{2}\times\frac{n}{2}$$ submatrics as follows:

$$\begin{bmatrix} C_1 & C_2 \\ C_3 & C_4\end{bmatrix}$$ = $$\begin{bmatrix} A_1 & A_2 \\ A_3 & A_4 \end{bmatrix} \cdot \begin{bmatrix} B_1 & B_2\\ B_3 & B_4 \end{bmatrix}$$

We define $$P_1, P_2, \cdots ,P_7$$ as follows:

$$P_1 = A_1\cdot(B_2-B_4) $$

$$ P_2 = (A_1+A_2)\cdot B_4$$

$$ P_3 = (A_3+A_4)\cdot B_1 $$

$$ P_4 = A_4\cdot(B_3-B_1) $$

$$ P_5 = (A_1+A_4)\cdot(B_1+B_4) $$

$$ P_6 = (A_2-A_4)\cdot(B_3+B_4) $$

$$ P_7 = (A_1-A_3)\cdot(B_1+B_2) $$

Here all the matrix multiplications are done **recursively**. Then each part of $$C$$ can be calculated by simple additions and subtractions among $$P_1, P_2, \cdots ,P_7$$.

Which of the following is the closest to the actual time complexity? @[C](3)

A. $$O(n^2\log_2 n)$$
B. $$O(n^e)$$
C. $$O(n^{\log_2 7})$$
D. $$O(n^3)$$




A.$$O(n^2\log_2 n)$$
B.$$O(n^e)$$
C.$$O(n^{\log_2 7})$$
D.$$O(n^3)$$


答案:C