Word Search
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizonta...
分类:
其他好文 时间:
2015-07-30 14:59:16
阅读次数:
126
Binary search in sorted ArrayQuestion 1Median of Two Sorted ArraysThere are two sorted arraysnums1andnums2of size m and n respectively. Find the media...
分类:
其他好文 时间:
2015-07-30 11:04:48
阅读次数:
186
题目:Given an array of integers, every element appearsthreetimes except for one. Find that single one.解法一:O(n*n)时间复杂度。编译一下,果然没通过。程序如下:不过我觉得本算法最简单,而且通用性是...
分类:
其他好文 时间:
2015-07-30 01:57:07
阅读次数:
115
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using...
分类:
其他好文 时间:
2015-07-30 00:55:12
阅读次数:
139
华电北风吹
天津大学认知计算与应用重点实验室
完成日期:2015/7/29Double-base palindromes
Problem 36
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.Find the sum of all numbers, less than one milli...
分类:
其他好文 时间:
2015-07-30 00:50:29
阅读次数:
139
题目:Given an array of integers, every element appearstwiceexcept for one. Find that single one.解法一: bit manipulate1 public class Solution {2 public...
分类:
其他好文 时间:
2015-07-30 00:29:04
阅读次数:
163
在java中用aes256进行加密,但是发现java里面不能使用PKCS7Padding,而java中自带的是PKCS5Padding填充,那解决办法是,通过BouncyCastle组件来让java里面支持PKCS7Padding填充。説辣么多不如上代码:public class AESUtil {...
分类:
编程语言 时间:
2015-07-30 00:26:35
阅读次数:
541
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined
betw...
分类:
其他好文 时间:
2015-07-29 23:04:12
阅读次数:
132
Given an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may assume that the arr...
分类:
其他好文 时间:
2015-07-29 22:54:17
阅读次数:
160
#include#includeint bug[2010],num[2010];int find(int x){int r=x;while(r!=bug[r])r=bug[r];bug[x]=r;return r;}void initial(){memset(bug,0,sizeof(bug));f...
分类:
其他好文 时间:
2015-07-29 22:44:57
阅读次数:
118