摘要:
Description In MATLAB, there is a very useful function called ‘reshape’, which can reshape a matrix into a new one with different size but keep its or 阅读全文
摘要:
DescriptionGiven an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200,... 阅读全文
摘要:
DescriptionImplement int sqrt(int x). Compute and return the square root of x.my program 思路:看似很简单的问题,可以不断的优化算法,最开始容易想到的是定义一个num使其递增,直到num*num... 阅读全文
摘要:
DescriptionGiven a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the... 阅读全文
摘要:
DescriptionGiven an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].my programclass Solution {... 阅读全文