2019年6月24日
摘要: 问题描述: Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear 阅读全文
posted @ 2019-06-24 13:39 狂奔的蜗牛163 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may 阅读全文
posted @ 2019-06-24 08:57 狂奔的蜗牛163 阅读(190) 评论(0) 推荐(0) 编辑
  2019年6月23日
摘要: 问题描述: Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root) 阅读全文
posted @ 2019-06-23 14:37 狂奔的蜗牛163 阅读(180) 评论(0) 推荐(0) 编辑
  2019年6月22日
摘要: 问题描述: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally 阅读全文
posted @ 2019-06-22 10:38 狂奔的蜗牛163 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is 阅读全文
posted @ 2019-06-22 10:37 狂奔的蜗牛163 阅读(157) 评论(0) 推荐(0) 编辑
  2019年6月21日
摘要: 问题: 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 yo 阅读全文
posted @ 2019-06-21 16:17 狂奔的蜗牛163 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example 阅读全文
posted @ 2019-06-21 14:01 狂奔的蜗牛163 阅读(292) 评论(0) 推荐(0) 编辑
  2019年6月20日
摘要: 问题描述: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid 阅读全文
posted @ 2019-06-20 14:33 狂奔的蜗牛163 阅读(235) 评论(0) 推荐(0) 编辑
  2016年10月17日
摘要: import java.io.*//生成代表输入流的对象fis=new FileInputStream("e:/src/from.txt") //生成代表输出流的对象 fos=new FileOutputStream("e:/src/to.txt")//生成一个字节数组byte [] buffer = new byte[1024]//当读取的文件为空值时,read方法返回值为-1int temp... 阅读全文
posted @ 2016-10-17 10:20 狂奔的蜗牛163 阅读(195) 评论(0) 推荐(0) 编辑
  2016年5月30日
摘要: score(self, X, y, sample_weight=None) 作用:返回该次预测的系数R2 其中R2 =(1-u/v)。u=((y_true - y_pred) ** 2).sum() v=((y_true - y_true.mean()) ** 2).sum() 其中可能得到的最好的 阅读全文
posted @ 2016-05-30 08:19 狂奔的蜗牛163 阅读(7354) 评论(0) 推荐(0) 编辑