题目:在字符串中找出第一个只出现一次的字符题解分析:用空间换时间,使用哈希表,key为字符,value是该字符出现的次数字符是一个长度为8的数据类型,因此总共只有256种可能,我们可以创建一个长为256的数组,每个字符根据其ASCII码值作为数组的下标,即哈希表的key,而相应数组位置存储每个字符出...
分类:
其他好文 时间:
2014-06-26 17:17:23
阅读次数:
223
题目描述:求数组的最大值和最小值,并且计算比较次数思路:(1)普通思路是遍历一遍,得比较2*N次(2)分治,具体计算可以参考书上内容,算法时间复杂度是O(logn) 1 #include 2 #include 3 #include 4 #include 5 #include 6 #incl...
分类:
其他好文 时间:
2014-06-26 17:13:38
阅读次数:
170
关键字:微信公众平台开发作者:方倍工作室在这篇微信公众平台开发教程中,我们假定你已经有了PHP语言程序、MySQL数据库、计算机网络通讯、及HTTP/XML/CSS/JS等基础。我们将使用微信公众账号方倍工作室作为讲解的例子,二维码见底部。本系列教程将引导你完成如下任务:创建新浪云计算平台应用启用微...
分类:
微信 时间:
2014-06-26 17:02:11
阅读次数:
590
在php中通过flash上传文件到服务器端时报413错误,原来一直以为是php.ini配置的问题,但是检查了php.ini的配置以后,发现不是php.ini的问题,最后是通过Http Analyzer监控然后发现问题的,在此真的感谢很Http Analyzer。然后在百度中输入关键字“413 Req...
分类:
其他好文 时间:
2014-06-26 16:59:21
阅读次数:
246
题目#include//最长上升子序列 nlogn//入口参数:数组名+数组长度,类型不限,结构体类型可以通过重载运算符实现//数组下标从1号开始。int bsearch(int a[],int len,int num){ int left=1,right=len; while(left...
分类:
其他好文 时间:
2014-06-26 16:20:12
阅读次数:
236
C#数组的排序(正序逆序) 这种排序 超级简单的 !using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication4{ class P...
分类:
其他好文 时间:
2014-06-26 16:13:39
阅读次数:
195
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4
5 6 7 0 1 2).
You are given a target value to search. If found in the array retur...
分类:
其他好文 时间:
2014-06-26 13:58:53
阅读次数:
203
http://202.121.199.212/JudgeOnline/problem.php?id=1746
analy: 无平方因子数,那就是不同的素因子个数一定不超过1,于是就朝这个方向努力:
先把2—10^9之间的所有素数求出来(也就是到99999989之间的所有素数用bool表打出来)
然后一个一个素因子判断过去;
...
分类:
其他好文 时间:
2014-06-26 13:25:49
阅读次数:
216
【题目】
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
【题意】
给定一个整数数组,其中除了一个数以外,其他数都是成对出现的,...
分类:
其他好文 时间:
2014-06-26 10:13:27
阅读次数:
254
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the...
分类:
其他好文 时间:
2014-06-26 07:09:01
阅读次数:
213