题目描述: Given an integer, write a function to determine if it is a power of two. 要完成的函数: bool isPowerOfTwo(int n) 说明: 1、给定一个int型整数,判断它是不是2的幂。首先我们可以确定负数和 ...
分类:
其他好文 时间:
2018-04-14 15:26:21
阅读次数:
169
Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege ...
分类:
移动开发 时间:
2018-04-12 00:12:55
阅读次数:
189
本文采用的jQuery源码为jquery-3.2.1.js jquery的on方法用来在选定的元素上绑定一个或多个事件处理函数。 当参数selector存在时,通常会用来对已经存在的元素或将来即将添加到文档中的元素做事件委托,表示当点击document中的selector元素时,将触发functio ...
分类:
Web程序 时间:
2018-04-10 19:43:19
阅读次数:
281
1. HDFS的基本概念和特性 设计思想——分而治之:将大文件、大批量文件分布式存放在大量服务器上,以便于采取分而治之的方式对海量数据进行运算分析。在大数据系统中作用:为各类分布式运算框架(如:mapreduce,spark,tez,....)提供数据存储服务。 1.1 HDFS的概念 首先,它是一 ...
分类:
其他好文 时间:
2018-04-07 11:15:58
阅读次数:
281
9. Palindrome Number 题目: Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative ...
分类:
其他好文 时间:
2018-04-06 19:36:00
阅读次数:
175
Determine if a small string is a substring of another large string.Return the index of the first occurrence of the small string in the large string.Re... ...
分类:
其他好文 时间:
2018-04-06 10:57:04
阅读次数:
134
The classic Two Glass Balls brain-teaser is often posed as: "Given two identical glass spheres, you would like to determine the lowest floor in a 100- ...
分类:
其他好文 时间:
2018-04-02 20:02:56
阅读次数:
186
Determine if the given integer array is min heap. ...
分类:
其他好文 时间:
2018-04-01 10:39:40
阅读次数:
185
做图的时候千万要小心,如果 当前点的邻居已经访问过了, 则不要再放入queue 中 否则一定死循环 所以图的 bfs 一定要 用一个字典来mark 访问过的点 ...
分类:
其他好文 时间:
2018-03-31 23:15:21
阅读次数:
185
1 题目 Determine whether an integer is a palindrome. Do this without extra space. 判断一个数字是否是回文数字,不用额外的空间。 2 分析 如果允许使用额外的空间,那么就将数字头尾颠倒,然后判断相等。但是缺陷在于,不能用在6 ...
分类:
其他好文 时间:
2018-03-24 11:34:32
阅读次数:
138