![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题
奔跑的椰子
Hello world !
Hello dream !
展开
-
leetCode刷题——Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 题意为:输出一个二叉树的深度 实现起来很容易。Accepted原创 2015-04-27 21:34:08 · 317 阅读 · 0 评论 -
leetCode刷题——Count Primes
Description: Count the number of prime numbers less than a non-negative number, n Hint: The number n could be in the order of 100,000 to 5,000,000. 题目觉得自己理解有误,理解的是在100,000到5,000,000里输出全部素数???原创 2015-04-27 20:38:20 · 312 阅读 · 0 评论 -
leetCode刷题——Same Tree
Given 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. 题意为:判断两棵二叉原创 2015-04-27 21:52:51 · 239 阅读 · 0 评论 -
算法之——上台阶
题目:有一楼梯共m级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第m级,共有多少走法?注:规定从一级到一级有0种走法。 输入 样例输入 输入数据首先包含一个整数n(1<=n<=100),表示测试实例的个数,然后是n行数据,每行包含一个整数m,(1<=m<=40), 表示楼梯的级数。 2 2 3 输出 样例输出 对于每个测试实例,请输出不同走法的数量。原创 2016-09-03 21:29:33 · 333 阅读 · 0 评论