摘要:
O(n)時(shí)間,O(1)空間對二叉樹進(jìn)行前序、中序、后序遍歷。詳細(xì)講解看參考。public class Solution { public static void morrisPreorder(TreeNode root) { TreeNode cur = root; ... 閱讀全文
posted @ 2014-09-09 22:36
jdflyfly
閱讀(339)
評論(0)
推薦(0)
摘要:
297. Serialize and Deserialize Binary Tree 思路:preorder遍歷 便于deserialize。時(shí)空O(N)。 public class Codec { // Encodes a tree to a single string. public Strin 閱讀全文
posted @ 2014-09-09 19:41
jdflyfly
閱讀(1347)
評論(0)
推薦(0)

浙公網(wǎng)安備 33010602011771號