import Foundation extension MyTreeNodeSolution { //递归 func inOrderTraversal(_ root: TreeNode?,_ n: inout [Int]) { if root == nil { return } ...
import Foundation class MyTreeNodeSolution { //递归 func preorderTraversal(_ root: TreeNode?,_ n: inout [Int]) { if root == nil { return } ...
import Foundation class SelectSortSolution { func sort(_ n: [Int]) -> [Int] { var s = n for i in 0..<s.count { let j =...
import Foundation class QuickSortSolution { func sort(_ n: [Int]) -> [Int] { var s = n quickSort(&s, 0, n.count - 1) return s } func quickS...