如何打印二叉樹斯威夫特使輸入79561打印輸出是這樣的: 7
/\
5 9
/\
1 6
我試着用For Loops和If Statements一些代碼來安排這一點,但它並沒有奏效。 我的代碼是: import UIKit
//Variable "node" used only to arrange it in output.
var node = "0"
var sp
我正在F#中實現一個簡單的BST實現,並且遇到了一個絆腳石,我找不到我的路。 此代碼: type BST =
| Empty
| TreeNode of int * BST * BST
let rec insert value tree = function
| Empty -> TreeNode(value, Empty, Empty)
| TreeNode(hd,