Given an array of integers, every element
appears twice except for one. Find that single one. Note: Your algorithm should
have a linear runtime comple...
分类:
其他好文 时间:
2014-05-23 07:22:48
阅读次数:
241
很多情况下,我们需要控件的背景是透明的,就是要求直接看到控件父窗口的背景颜色、背景位图,比如标签控件、单选Radio控件、复选Check控件,通常都要求在父窗口的背景上进行绘制。然而要求控件的画布透明,这个技术在GDI的文档中没有看到Microsoft作任何说明,当然还是有别的办法。其一:如果程序支...
分类:
其他好文 时间:
2014-05-23 02:55:14
阅读次数:
326
Determine whether an integer is a palindrome.
Do this without extra space.if use recursive, like check the first dig and last
dig, then remove them, c...
分类:
其他好文 时间:
2014-05-23 02:45:15
阅读次数:
230
Given two binary trees, write a function to
check if they are equal or not.Two binary trees are considered equal if they are
structurally identical an...
分类:
其他好文 时间:
2014-05-22 16:46:03
阅读次数:
173
Given an array of integers, every element
appearstwiceexcept for one. Find that single one.Note:Your algorithm should have
a linear runtime complexity...
分类:
其他好文 时间:
2014-05-22 16:31:03
阅读次数:
194
Say you have an array for which theithelement
is the price of a given stock on dayi.Design an algorithm to find the maximum
profit. You may complete a...
分类:
其他好文 时间:
2014-05-21 17:27:55
阅读次数:
252
1、下载python3.3安装包#wget wget --no-cookie
--no-check-certificate --header "Cookie:gpw_e24=http%3A%2F%2Fwww.oracle.com%2F"
http://www.python.org/ftp/pytho...
分类:
编程语言 时间:
2014-05-21 17:23:59
阅读次数:
391
【题目】
Given an unsorted integer array, find the first missing positive integer.
For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.
Your algorithm should run in O(n) time and uses constant space.
【题意】
给定一个数组,找出第一个缺失的正数。时间复杂度O(n)
...
分类:
其他好文 时间:
2014-05-21 17:13:07
阅读次数:
219
Detect Cycle in a Directed Graph
判断一个图是否有环,有环图如下:
这里唯一注意的就是,这是个有向图, 边组成一个环,不一定成环,因为方向可以不一致。
这里就是增加一个数组保存当前已经访问过的路径信息 recStack[];
而visited[]数组是访问过的点的信息,两者作用是不一样的。
助理这个知识点,这道题就很容易了。
原文:
h...
分类:
其他好文 时间:
2014-05-21 15:07:14
阅读次数:
269
利用Union Find的方法查找图中是否有环。
在于构建一个图数据结构,和一般图的数据结构不同的是这个图是记录了边的图,并在查找过程中不断把边连接起来,形成一个回路。
原文地址:
http://www.geeksforgeeks.org/union-find/
#pragma once
#include
#include
#include
#include
class Un...
分类:
其他好文 时间:
2014-05-21 14:12:15
阅读次数:
287