mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-02 21:24:53 +08:00
feat: add Swift codes for graph_operations article (#327)
This commit is contained in:
@ -82,4 +82,12 @@ public enum PrintUtil {
|
||||
let root = TreeNode.listToTree(list: queue)
|
||||
printTree(root: root)
|
||||
}
|
||||
|
||||
public static func printMatrix<T>(matrix: [[T]]) {
|
||||
print("[")
|
||||
for row in matrix {
|
||||
print(" \(row),")
|
||||
}
|
||||
print("]")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user