Question 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 m ...
分类:
其他好文 时间:
2016-10-23 07:50:32
阅读次数:
271
Problem: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the f ...
分类:
其他好文 时间:
2016-10-23 07:37:00
阅读次数:
187
因为项目需要搞一个折线图,按照日期显示相应的成绩,所以有了本文。 以前用过一次XCL-chart,但是感觉只适合固定图表,不去滑动的那种,因为你一滑动太卡了你懂得(毕竟作者好久没更新优化了),拙言大神我开玩笑的 ,毕竟我加你的群大半年了 - - 第二研究了一下achartenginee图表框架,一不 ...
分类:
移动开发 时间:
2016-10-22 23:46:56
阅读次数:
712
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexi ...
分类:
其他好文 时间:
2016-10-21 08:00:01
阅读次数:
202
题意: 给定非排序数组,找出其排序后相邻元素的最大差值。 线性时间空间、元素数少于2时返回0、元素值非负且int范围内。 思路: 排序最快nlogn不符合要求; 参考网上,学习了桶排序的方法; 桶排序:按值分段处理; 设定桶大小和桶个数; 因为ans>=(MAX-MIN)/(len-1); 桶大小: ...
分类:
其他好文 时间:
2016-10-21 00:18:09
阅读次数:
116
Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the knumb ...
html5移动开发细微之美 1、H5页面窗口自动调整到设备宽度,并禁止用户缩放页面 <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user ...
分类:
移动开发 时间:
2016-10-18 15:50:18
阅读次数:
216
1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-s ...
分类:
其他好文 时间:
2016-10-16 23:38:24
阅读次数:
284
https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array/ 利用了异或的”自反性“: a ^ b = c,而a ^ b ^ b = a, 则 c ^ b = a 其他运算定律有:交换律、结合律、分配律。 ...
分类:
其他好文 时间:
2016-10-16 13:54:22
阅读次数:
128