上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 22 下一页
摘要: Question:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which ... 阅读全文
posted @ 2015-07-14 13:39 Maydow 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Question:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the n... 阅读全文
posted @ 2015-07-14 13:10 Maydow 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Question:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the giv... 阅读全文
posted @ 2015-07-14 11:45 Maydow 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Question:GivennumRows, generate the firstnumRowsof Pascal's triangle.For example, givennumRows= 5,Return[ [1], [1,1], [1,2,1], [1,3,3,1], [1... 阅读全文
posted @ 2015-07-14 11:11 Maydow 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Question:Given an indexk, return thekthrow of the Pascal's triangle. For example, givenk= 3, Return[1,3,3,1].1、题型分类:2、思路:直接使用公式,第n行 第0个数是1,从第i个数开始一次... 阅读全文
posted @ 2015-07-14 10:53 Maydow 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Question:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a ca... 阅读全文
posted @ 2015-07-14 09:25 Maydow 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Question:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -... 阅读全文
posted @ 2015-07-14 08:55 Maydow 阅读(151) 评论(0) 推荐(0) 编辑
摘要: Question:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists:A: ... 阅读全文
posted @ 2015-07-13 22:40 Maydow 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Question:Compare two version numbersversion1andversion2.Ifversion1>version2return 1, ifversion1i2[i]) return 1; else if(i1[i... 阅读全文
posted @ 2015-07-13 22:08 Maydow 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 在java.lang包中有String.split()方法,返回是一个数组我在应用中用到一些,给大家总结一下,仅供大家参考:1、如果用“.”作为分隔的话,必须是如下写法,String.split("\\."),这样才能正确的分隔开,不能用String.split(".");2、如果用“|”作为分隔的... 阅读全文
posted @ 2015-07-13 21:44 Maydow 阅读(246) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 22 下一页