摘要:
Same TreeSep 3 '12Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.bad one recursive./** * Definition for binary tree * public class TreeNode { * int val; * ... 阅读全文
摘要:
Count and SayMar 6 '12The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"two 1s"or21.21is read off as"one 2, thenone 1"or1211.Given an integern, generate thenthsequence. 阅读全文