上一页 1 2 3 4 5 6 ··· 16 下一页
摘要: Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive. For example, given the range [5, 阅读全文
posted @ 2016-07-13 16:17 Miller1991 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary tree and sum 阅读全文
posted @ 2016-07-13 14:08 Miller1991 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the f 阅读全文
posted @ 2016-07-13 11:34 Miller1991 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2016-07-13 11:01 Miller1991 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 基本字符 I V X L C D M 相应的阿拉伯数字表示为 1 5 10 50 1 阅读全文
posted @ 2016-07-13 10:29 Miller1991 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 基本字符 I V X L C D M 相应的阿拉伯数字表示为 1 5 10 50 1 阅读全文
posted @ 2016-07-13 10:16 Miller1991 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 题目给出的数据是一组2-8岁男童的身高。x是年龄,y是身高。样本数m=50. 使用gradient descent来做线性回归。 step1:数据准备。 加载数据: >> x=load('ex2x.dat'); >> y=load('ex2y.dat'); 可视化数据: 效果如下: 我们将模型设定为 阅读全文
posted @ 2016-07-12 11:25 Miller1991 阅读(276) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here a 阅读全文
posted @ 2016-07-11 10:48 Miller1991 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan 阅读全文
posted @ 2016-07-11 10:13 Miller1991 阅读(191) 评论(0) 推荐(0) 编辑
摘要: Given two arrays, write a function to compute their intersection. Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Note: Each elemen 阅读全文
posted @ 2016-07-08 16:43 Miller1991 阅读(271) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 16 下一页