摘要:
You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
摘要:
Given a binary tree, return the preorder traversal of its nodes' values. Example Given: 1 / \ 2 3 / \ 4 5 return [1,2,4,5,3]. Challenge Can you do it 阅读全文
摘要:
Given a binary tree, return the postorder traversal of its nodes' values. Example Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [3,2,1]. Challenge Can 阅读全文
摘要:
Given a binary tree, return all root-to-leaf paths. 这道题主要利用一下java的一个特性,String是immutable的对象,不能修改,只能重新生成 /** * Definition of TreeNode: * public class Tr 阅读全文
摘要:
Given a binary tree, return the inorder traversal of its nodes' values. Example Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,3,2]. Challenge Can y 阅读全文
摘要:
You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1's 阅读全文