12 2017 档案

Leetcode:206. Reverse Linked List
摘要:这题直接ac掉 阅读全文

posted @ 2017-12-30 17:04 Michael2397 阅读(144) 评论(0) 推荐(0)

leetcode:234. Palindrome Linked List
摘要:这个题目非常好。http://blog.csdn.net/u012249528/article/details/47124771给出了三种解法,其中前两个是不满足条件的,不过具有参考价值: 第一种办法:用数组倒着存前半段的链表的值,然后和后半段链表的值进行比较。这种解法运行的时间最久可能是因为数组倒 阅读全文

posted @ 2017-12-23 11:33 Michael2397 阅读(185) 评论(0) 推荐(0)

java单链表反转
摘要:今天做leetcode,遇到了单链表反转。研究了半天还搞的不是太懂,先做个笔记吧 参考:http://blog.csdn.net/guyuealian/article/details/51119499 https://www.cnblogs.com/hiver/p/7008112.html (二)实 阅读全文

posted @ 2017-12-21 12:37 Michael2397 阅读(171) 评论(0) 推荐(0)

Leetcode:9. Palindrome Number
摘要:这题要求不能使用额外的空间,我也就没做,看了下别人的代码,挺有意义的一道题目,出坏了。 解题思路:从右往左颠倒过来,看看这个值和原来的x值是不是一样,最后还要注意像20这种情况,也是的 阅读全文

posted @ 2017-12-21 10:00 Michael2397 阅读(123) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第七章(创建增强类)
摘要: 阅读全文

posted @ 2017-12-20 12:34 Michael2397 阅读(245) 评论(0) 推荐(0)

leetcode:8. String to Integer (atoi)
摘要:这题难就难在不知道要考虑那些情况,也没个实例 参考:https://www.cnblogs.com/springfor/p/3896499.html有四个条件需要考虑: 自己参考上面四个条件写出了自己的代码,结果老是错。例如:“+-2”,结果应该是0 参考实现https://www.cnblogs. 阅读全文

posted @ 2017-12-20 10:45 Michael2397 阅读(111) 评论(0) 推荐(0)

leetcode:7. Reverse Integer
摘要:这题简单,也花了我好长时间,我自己写的code比较麻烦,也没啥技巧:按正负性分类执行,先转化成字符串,用stringbuilder进行旋转,如果超出范围了就用try catch 这种方法要好一些:https://discuss.leetcode.com/topic/15134/very-short- 阅读全文

posted @ 2017-12-20 09:51 Michael2397 阅读(131) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第七章(AOP基础知识、jdk动态代理,CGLib动态代理)
摘要: 阅读全文

posted @ 2017-12-20 00:34 Michael2397 阅读(131) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第七章(AOP概念)
摘要: 阅读全文

posted @ 2017-12-20 00:09 Michael2397 阅读(166) 评论(0) 推荐(0)

Leetcode:6. ZigZag Conversion
摘要:参考:http://blog.csdn.net/linhuanmars/article/details/21145039#reply,找规律 阅读全文

posted @ 2017-12-19 10:13 Michael2397 阅读(107) 评论(0) 推荐(0)

Leetcode:647. Palindromic Substrings
摘要:参考第5题http://www.cnblogs.com/Michael2397/p/8036163.html,一下子就ac掉了,这里有个解释https://discuss.leetcode.com/topic/96884/very-simple-java-solution-with-detail-e 阅读全文

posted @ 2017-12-19 09:24 Michael2397 阅读(137) 评论(0) 推荐(0)

Leetcode:516. Longest Palindromic Subsequence
摘要:参考:http://algorithms.tutorialhorizon.com/longest-palindromic-subsequence/ (老外写的博文,有图有字很形象)http://blog.csdn.net/thesnowboy_2/article/details/55251028(中 阅读全文

posted @ 2017-12-18 12:37 Michael2397 阅读(150) 评论(0) 推荐(0)

Leetcode:336. Palindrome Pairs
摘要:这题一上来就会想到暴力破解,破解代码见http://blog.csdn.net/u012848330/article/details/51660542,超时 Accept参考:https://discuss.leetcode.com/topic/40657/150-ms-45-lines-java- 阅读全文

posted @ 2017-12-18 10:41 Michael2397 阅读(233) 评论(0) 推荐(0)

Leetcode:214. Shortest Palindrome
摘要:解法一:很奇妙的解法:https://www.programcreek.com/2014/06/leetcode-shortest-palindrome-java/ 阅读全文

posted @ 2017-12-15 10:23 Michael2397 阅读(155) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第六章(容器事件)
摘要: 阅读全文

posted @ 2017-12-14 17:54 Michael2397 阅读(180) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第六章(国际化)
摘要: 阅读全文

posted @ 2017-12-14 17:24 Michael2397 阅读(211) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第六章(引用Bean的属性值)
摘要: 阅读全文

posted @ 2017-12-14 16:56 Michael2397 阅读(138) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第六章(使用外部属性文件)
摘要: 阅读全文

posted @ 2017-12-14 16:33 Michael2397 阅读(177) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第六章(属性编辑器)
摘要: 阅读全文

posted @ 2017-12-14 15:57 Michael2397 阅读(184) 评论(0) 推荐(0)

Leetcode:5. Longest Palindromic Substring
摘要:一开始题目没读懂,下面是求首末是同一个字符的最长子字符串 : 看到是求解最长回文串,也蒙逼了,不会写,这里参考的是:http://blog.csdn.net/linhuanmars/article/details/20888595 第二种方法是动态规划,没看太懂 http://blog.csdn.n 阅读全文

posted @ 2017-12-14 09:53 Michael2397 阅读(255) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第六章(内部工作机制、BeanDefinition、InstantiationStrategy、BeanWrapper)
摘要: 阅读全文

posted @ 2017-12-14 00:38 Michael2397 阅读(188) 评论(0) 推荐(0)

Leetcode: 3. Longest Substring Without Repeating Characters
摘要:这题一开始我理解错了。后来自己去解也没完成,看了参考,看了半天没懂为什么,虽然代码短,但是逻辑性很高~ 解题思想:设置滑动窗口 阅读全文

posted @ 2017-12-13 20:20 Michael2397 阅读(140) 评论(0) 推荐(0)

4. Median of Two Sorted Arrays
摘要:一看题目难度是“难”,吓到我了,上午想了一会就看讨论组的解法了,解法都很发杂呀!!!下午来到实验室看了一篇中文博客,说有两种解决方案,第一种就是将两个数组合并成一个数组,我的解法就是这样子的,竟然ac掉了!! 阅读全文

posted @ 2017-12-13 15:40 Michael2397 阅读(238) 评论(0) 推荐(0)

Leetcode:445. Add Two Numbers II
摘要:这题可以结合着前面几个博客的思想来解决,当然网上给出了更好的解决方案值得学习 我自己实现的代码,因为对java指针的使用不太熟悉,调试了一个小时。思路:先将l1,l2存放到字符串中(因为字符串的长度不受限制,而数组的长度会受到限制),然后从数组的最后一位开始计算 网上的代码:https://disc 阅读全文

posted @ 2017-12-12 21:24 Michael2397 阅读(236) 评论(0) 推荐(0)

Leetcode: 43. Multiply Strings
摘要:题目难度中等,想到分别遍历num1、num2中的数值,但是具体细节没有理清。参考:https://discuss.leetcode.com/topic/30508/easiest-java-solution-with-graph-explanation?page=1 阅读全文

posted @ 2017-12-12 19:34 Michael2397 阅读(135) 评论(0) 推荐(0)

Leetcode:415. Add Strings
摘要:结合着这篇http://www.cnblogs.com/Michael2397/p/8027782.html自己完全实现了,顿时感觉到刷题有套路啊 阅读全文

posted @ 2017-12-12 15:34 Michael2397 阅读(128) 评论(0) 推荐(0)

Leetcode: 371. Sum of Two Integers
摘要:这一题要用到|,&,<<等运算,完全参考https://discuss.leetcode.com/topic/49764/0ms-ac-java-solution/2算是当作学习了 阅读全文

posted @ 2017-12-12 15:32 Michael2397 阅读(156) 评论(0) 推荐(0)

Leetcode: 67. Add Binary
摘要:二进制加法 https://discuss.leetcode.com/topic/33693/another-simple-java 阅读全文

posted @ 2017-12-12 14:53 Michael2397 阅读(138) 评论(0) 推荐(0)

Leetcode: 2. Add Two Numbers
摘要:一直想用一个进位变量来存贮进位值,但老是考虑不周全,下面是我自己写的bug代码,考虑不周,因为l1或者l2都有可能为null acccpt:https://discuss.leetcode.com/topic/799/is-this-algorithm-optimal-or-what 阅读全文

posted @ 2017-12-11 21:15 Michael2397 阅读(136) 评论(0) 推荐(0)

Leetcode:560. Subarray Sum Equals K
摘要:最简单的方式,虽然oj没有说超时,但是时间还是挺多的 本次的方法是遍历所有起点是最开始元素的子序列,我们起名叫sum[i],只要两个sum[i]的差值是k,则两个i作为起点和终点的子序列就符合要求。由于起点就是最开始元素,只需遍历终点,时间复杂度为O(n)。 阅读全文

posted @ 2017-12-11 20:13 Michael2397 阅读(147) 评论(0) 推荐(0)

Leetcode: 653. Two Sum IV - Input is a BST
摘要:超时代码:只多了一个bool变量就超时了 accpt的代码,把二叉树前序遍历得到list,顺序是从小到大排列的 阅读全文

posted @ 2017-12-11 09:48 Michael2397 阅读(135) 评论(0) 推荐(0)

Leetcode: 167. Two Sum II - Input array is sorted
摘要:超时的代码: Accept代码:如果数组已经排好序了,就尽可能的使用while(),左右遍历 阅读全文

posted @ 2017-12-11 09:14 Michael2397 阅读(103) 评论(0) 推荐(0)

Leetcode:454. 4Sum II
摘要:参考:https://discuss.leetcode.com/topic/67658/simple-java-solution-with-explanation 阅读全文

posted @ 2017-12-11 08:59 Michael2397 阅读(111) 评论(0) 推荐(0)

LeetCode: 18. 4Sum
摘要:递归调用的例子,参考网上的实现https://discuss.leetcode.com/topic/46339/my-solution-generalized-for-ksums-in-java/5 阅读全文

posted @ 2017-12-11 00:46 Michael2397 阅读(130) 评论(0) 推荐(0)

LeetCode:15. 3Sum
摘要:自己的解法,有问题,花费我三个小时 网上的解法 阅读全文

posted @ 2017-12-10 20:32 Michael2397 阅读(162) 评论(0) 推荐(0)

Leetcode:1. Two Sum
摘要:public class TwoSum1 { public static void main(String[] args) { int[] nums = new int[]{2, 7, 11, 15}; int target = 9; int a[] = new int[2]; a = twoSum(nums, targe... 阅读全文

posted @ 2017-12-10 17:00 Michael2397 阅读(138) 评论(0) 推荐(0)

tensorflow placeholder
摘要:placeholder 是 Tensorflow 中的占位符,暂时储存变量. Tensorflow 如果想要从外部传入data, 那就需要用到 tf.placeholder(), 然后以这种形式传输数据 sess.run(***, feed_dict={input: **}). 需要传入的值放在了f 阅读全文

posted @ 2017-12-07 10:53 Michael2397 阅读(379) 评论(0) 推荐(0)

Tensorflow变量
摘要:import tensorflow as tf state = tf.Variable(0, name='counter') # 定义常量 one one = tf.constant(1) # 定义加法步骤 (注: 此步并没有直接计算) new_value = tf.add(state, one) # 将 State 更新成 new_value update = tf.assign(sta... 阅读全文

posted @ 2017-12-07 10:48 Michael2397 阅读(144) 评论(0) 推荐(0)

tensorflow session会话控制
摘要:Session 是 Tensorflow 为了控制,和输出文件的执行的语句. 运行 session.run() 可以获得你要得知的运算结果, 或者是你所要运算的部分. 阅读全文

posted @ 2017-12-07 10:36 Michael2397 阅读(171) 评论(0) 推荐(0)

tensorflow第一个例子
摘要:import tensorflow as tf import numpy as np # create data x_data = np.random.rand(100).astype(np.float32) y_data = x_data*0.1 + 0.3 Weights = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) biases = t... 阅读全文

posted @ 2017-12-07 01:56 Michael2397 阅读(159) 评论(0) 推荐(0)

sklearn保存模型
摘要:最后可以知道joblib在使用上比较容易,读取速度也相对pickle快。 阅读全文

posted @ 2017-12-06 23:18 Michael2397 阅读(181) 评论(0) 推荐(0)

sklearn解决过拟合的例子
摘要:Learning curve 检视过拟合 sklearn.learning_curve 中的 learning curve 可以很直观的看出我们的 model 学习的进度, 对比发现有没有 overfitting 的问题. 然后我们可以对我们的 model 进行调整, 克服 overfitting 阅读全文

posted @ 2017-12-06 22:57 Michael2397 阅读(3855) 评论(0) 推荐(0)

sklearn交叉验证法(Cross Validation)
摘要:一般来说准确率(accuracy)会用于判断分类(Classification)模型的好坏。 一般来说平均方差(Mean squared error)会用于判断回归(Regression)模型的好坏。 阅读全文

posted @ 2017-12-06 22:12 Michael2397 阅读(886) 评论(0) 推荐(0)

sklearn正规化(Normalization或者scale)
摘要:from sklearn import preprocessing import numpy as np a = np.array([[10,2.7,3.6],[-100,5,-2],[120,20,40]],dtype=np.float64) print(a) print(preprocessing.scale(a)) from sklearn import preprocessin... 阅读全文

posted @ 2017-12-06 21:43 Michael2397 阅读(993) 评论(0) 推荐(0)

sklearn有关参数
摘要:from sklearn import datasets from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt #加载数据 loaded_data = datasets.load_boston() data_X = loaded_data.data data_Y = loaded_da... 阅读全文

posted @ 2017-12-06 21:06 Michael2397 阅读(188) 评论(0) 推荐(0)

sklearn常用数据的使用
摘要:from sklearn import datasets from sklearn.linear_model import LinearRegression #加载数据 loaded_data = datasets.load_boston() data_X = loaded_data.data data_Y = loaded_data.target #是否需要对数据进行拆分 #定义模型 mode... 阅读全文

posted @ 2017-12-06 20:56 Michael2397 阅读(200) 评论(0) 推荐(0)

sklearn实现聚类
摘要:import numpy as np from sklearn import datasets from sklearn.cross_validation import train_test_split from sklearn.neighbors import KNeighborsClassifier iris = datasets.load_iris() iris_X = iris... 阅读全文

posted @ 2017-12-06 20:29 Michael2397 阅读(726) 评论(0) 推荐(0)

sklearn
摘要:基于Anaconda安装:http://blog.csdn.net/tz_zs/article/details/73459800 官方地址:http://scikit-learn.org/stable/tutorial/index.html 中文0.18文档:http://cwiki.apachec 阅读全文

posted @ 2017-12-06 20:28 Michael2397 阅读(126) 评论(0) 推荐(0)

keras安装windows版
摘要:按照官网成功了。下面没有成功,貌似是 Anacode的问题 http://blog.csdn.net/hweiyi/article/details/70018317 http://blog.csdn.net/lwplwf/article/details/54896088 根据上述两个链接安装好ker 阅读全文

posted @ 2017-12-04 21:32 Michael2397 阅读(172) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(不同配置方式比较)
摘要: 阅读全文

posted @ 2017-12-03 09:27 Michael2397 阅读(156) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(通过编码方式动态添加Bean)
摘要: 阅读全文

posted @ 2017-12-03 09:22 Michael2397 阅读(145) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(基于Java类的配置)
摘要: 阅读全文

posted @ 2017-12-02 22:25 Michael2397 阅读(136) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(基于注解的配置)
摘要: 阅读全文

posted @ 2017-12-02 21:42 Michael2397 阅读(158) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(FactoryBean)
摘要: 阅读全文

posted @ 2017-12-02 20:42 Michael2397 阅读(131) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(Bean作用域)
摘要: 阅读全文

posted @ 2017-12-02 20:31 Michael2397 阅读(173) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(<bean>之间的关系\整合多个配置文件)
摘要: 阅读全文

posted @ 2017-12-02 19:53 Michael2397 阅读(141) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(方法注入)
摘要: 阅读全文

posted @ 2017-12-02 18:55 Michael2397 阅读(122) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(注入参数详解)
摘要: 阅读全文

posted @ 2017-12-02 16:14 Michael2397 阅读(216) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第五章(装配Bean,依赖注入)
摘要: 阅读全文

posted @ 2017-12-02 16:07 Michael2397 阅读(209) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第四章(Application中Bean的生命周期)
摘要:package com.smart.beanfactory; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.... 阅读全文

posted @ 2017-12-02 11:25 Michael2397 阅读(190) 评论(0) 推荐(0)

《精通Spring4.X企业应用开发实战》读后感第四章(BeanFactory生命周期)
摘要:package com.smart; import org.springframework.beans.BeansException; import org.springframework.beans.factory.*; public class Car implements BeanFactoryAware, BeanNameAware, InitializingB... 阅读全文

posted @ 2017-12-01 00:05 Michael2397 阅读(186) 评论(0) 推荐(0)

导航