mirror of
https://github.com/krahets/hello-algo.git
synced 2026-11-01 18:55:23 +08:00
* feat(ko): add the complete Korean online edition * Use UTF-8 for Python CI output on Windows * Remove print-book promotion from the Korean site * fix(ko): preserve emphasis before Korean particles
27 lines
470 B
Go
27 lines
470 B
Go
// File: space_complexity_test.go
|
|
// Created Time: 2022-12-15
|
|
// Author: cathay ([email protected])
|
|
|
|
package chapter_computational_complexity
|
|
|
|
import (
|
|
"testing"
|
|
|
|
. "github.com/krahets/hello-algo/pkg"
|
|
)
|
|
|
|
func TestSpaceComplexity(t *testing.T) {
|
|
n := 5
|
|
// 상수 차수
|
|
spaceConstant(n)
|
|
// 선형 차수
|
|
spaceLinear(n)
|
|
spaceLinearRecur(n)
|
|
// 제곱 차수
|
|
spaceQuadratic(n)
|
|
spaceQuadraticRecur(n)
|
|
// 지수 차수
|
|
root := buildTree(n)
|
|
PrintTree(root)
|
|
}
|