题目:
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next() and...
分类:
其他好文 时间:
2015-03-29 00:38:50
阅读次数:
201
Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A ...
分类:
其他好文 时间:
2015-03-29 00:33:18
阅读次数:
138
createproc proc_paging(@pageSizeint,@pageCurrentint)asbeginselect*from(selectROW_NUMBER()over(ORDERBY 排序字段) rownum,*from 表) 别名whererownum between(@pag...
分类:
数据库 时间:
2015-03-29 00:28:59
阅读次数:
189
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=32356Given a sequence of n numbers a1, a2, ..., anand a number of d-queries. A d-quer...
分类:
其他好文 时间:
2015-03-28 23:12:30
阅读次数:
238
package yun;import java.util.Random;import java.util.*;public class number { /** * 作者:范铭祥 * 功能:一个简单的小学生四则运算生成系统 */ public static voi...
分类:
其他好文 时间:
2015-03-28 23:05:00
阅读次数:
158
Distinct Subsequences问题:Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which...
分类:
其他好文 时间:
2015-03-28 21:45:13
阅读次数:
167
Single NumberGiven an array of integers, every element appearstwiceexcept for one. Find that single one. def singleNumber(self, A): l = len(...
分类:
编程语言 时间:
2015-03-28 21:44:31
阅读次数:
234
/*异或的简单应用 a^a = 0*/class Solution {public: int singleNumber(int A[], int n) { int sum = 0; for(int i = 0 ; i < n ; i++){ s...
分类:
其他好文 时间:
2015-03-28 21:41:34
阅读次数:
115
标题:Two Sum通过率:17.9%难度:中等Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should retu...
分类:
其他好文 时间:
2015-03-28 21:32:14
阅读次数:
110
这是leetcode的第九题,相对来说比较简单,目的很简单,就是判断一个int型的数是不是回文数。但是有几点需要考虑:
负数应该没有回文数,要加判断!要注意额外的空间申请问题。判断是否是回文数势必要对一个数进行反转,反转的时候就要考虑溢出的问题。实现的代码如下:#include
bool isPalindrom(int x)
{
if(x<0)
return false;
el...
分类:
其他好文 时间:
2015-03-28 20:30:37
阅读次数:
120