05 2017 档案

摘要: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 original data. 阅读全文
posted @ 2017-05-27 11:00 D-Dong 阅读(320) 评论(0) 推荐(0)
摘要:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Example 1: Exa 阅读全文
posted @ 2017-05-27 10:41 D-Dong 阅读(289) 评论(0) 推荐(0)
摘要:判断一个整数是不是2的幂。 关键是弄明白2的幂的二进制形式只有一个1。 相似题:判断一个数是不是3的幂。 方法一:循环 方法二:转3进制 10进制,1(100)、10(101)、100(102)……; 2进制,1(20)、10(21)、100(22)……; 3进制,1(30)、10(31)、100( 阅读全文
posted @ 2017-05-26 11:53 D-Dong 阅读(346) 评论(0) 推荐(0)
摘要:Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2017-05-25 21:13 D-Dong 阅读(287) 评论(0) 推荐(0)
摘要:Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example,Given nums = [0, 1, 阅读全文
posted @ 2017-05-25 15:52 D-Dong 阅读(254) 评论(0) 推荐(0)
摘要:翻转32位无符号二进制整数 Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010 阅读全文
posted @ 2017-05-25 15:18 D-Dong 阅读(396) 评论(0) 推荐(0)
摘要:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit 阅读全文
posted @ 2017-05-25 14:36 D-Dong 阅读(239) 评论(0) 推荐(0)
摘要:https://leetcode.com/problems/hamming-distance/#/description 输入:两个整数x,y,且0 ≤ x, y < 231。 输出:x,y的二进制表示,不同的有几位。 Example: 阅读全文
posted @ 2017-05-25 11:54 D-Dong 阅读(310) 评论(0) 推荐(0)
摘要:导致原因:Javaweb工程类中没有添加Tomcat运行时相关类。 解决方法: 右击 web 工程 -> Properties 或 Build Path -> Configure Build Path -> Libraries -> Add Libray -> Server Runtime -> T 阅读全文
posted @ 2017-05-24 17:01 D-Dong 阅读(250) 评论(0) 推荐(0)
摘要:将源码转换为工程: 比如查看Spring事务部分的源码。 打开cmd窗口,切换到Spring-tx文件夹下,执行命令 “gradle cleanidea eclipse” 。 缺失jar包: 第一步:切换到spring源码的lib目录 第二步:解压lib目录下的spring-core-4.2.6.R 阅读全文
posted @ 2017-05-23 21:49 D-Dong 阅读(1408) 评论(0) 推荐(0)