Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 코딩테스트
- Binary Search
- 코테
- Matrix
- greedy
- sorting
- Class
- geometry
- hash table
- 구현
- 자바
- two pointers
- Counting
- Tree
- Number Theory
- Data Structure
- string
- simulation
- java
- Stack
- array
- implement
- Math
- SQL
- Binary Tree
- Method
- database
- 파이썬
- bit manipulation
- dynamic programming
Archives
- Today
- Total
코린이의 소소한 공부노트
Strassen's Matrix Multiplication Algorithm (no example) 본문
1. Problem
- 두 개의 n*n 행렬의 곱을 해보자. 여기서 n은 2의 거듭제곱이다.
- 슈트라센은 행렬을 4개로 나눠서 계산하는 방식을 택했다.
2. Input
1) 행렬의 길이 n
2) n*n 행렬 A
3) n*n 행렬 B
3. Output
1) A와 B의 곱이 담긴 행렬 C
4. PseudoCode
void strassen(int n, matrix A, matrix B, matrix C){
if(n<=threshold)
compute C = A * B using the standard algorithm;
else{
partition A into 4 submatrices A11, A12, A21, A22;
partition B into 4 submatrices B11, B12, B21, B22;
compute C = A * B using the standard algorithm;
// example recursive call
// strassen(n/2, A11+A22, B11+B22, M1);
}
}
'Back-End > Algorithm' 카테고리의 다른 글
Binomial Coefficient (recursive) (0) | 2023.03.07 |
---|---|
Dynamic Programming (0) | 2023.03.07 |
Quick Sort (partition exchange sort) (0) | 2023.03.02 |
Merge Sort (recursive, less memory, in-place) (0) | 2023.02.24 |
Merge Sort (recursive) (0) | 2023.02.23 |