mirror of
https://github.com/krahets/hello-algo.git
synced 2026-04-14 02:10:37 +08:00
build
This commit is contained in:
@@ -1820,9 +1820,9 @@ Quadratic order is common in matrices and graphs, where the number of elements i
|
||||
/* 平方阶 */
|
||||
fun quadratic(n: Int) {
|
||||
// 矩阵占用 O(n^2) 空间
|
||||
val numMatrix: Array<Array<Int>?> = arrayOfNulls(n)
|
||||
val numMatrix = arrayOfNulls<Array<Int>?>(n)
|
||||
// 二维列表占用 O(n^2) 空间
|
||||
val numList: MutableList<MutableList<Int>> = arrayListOf()
|
||||
val numList = mutableListOf<MutableList<Int>>()
|
||||
for (i in 0..<n) {
|
||||
val tmp = mutableListOf<Int>()
|
||||
for (j in 0..<n) {
|
||||
|
||||
Reference in New Issue
Block a user