Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
分类:
其他好文 时间:
2014-09-01 12:15:43
阅读次数:
169
==================================主程序usingSystem;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespaceConsoleApplication6
{
classProgram
{
staticvoidMain(string[]args)
{
//有序列表会按照键排序
Sorted..
分类:
其他好文 时间:
2014-09-01 02:55:53
阅读次数:
155
Question:Given an M x N matrix in which each row and each column is sorted in ascending order, write a method to find an element. 1 package POJ; 2 3 ....
分类:
其他好文 时间:
2014-09-01 02:44:02
阅读次数:
209
Combinations
Total Accepted: 18327 Total
Submissions: 60479My Submissions
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4...
分类:
其他好文 时间:
2014-09-01 01:40:32
阅读次数:
204
题目:
Divide two integers without using multiplication, division and mod operator.
解析:...
分类:
其他好文 时间:
2014-08-31 22:58:02
阅读次数:
246
题目Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the o...
分类:
其他好文 时间:
2014-08-31 22:39:31
阅读次数:
324
昨天 yep 问了一个问题:
For two positive integers a and b, the Ulam sequence U(a,b) is defined by U(a,b)1 = a, U(a,b)2 = b and for k > 2, U(a,b)k is the smallest integer greater
than U(a,b)(k-1) which can...
分类:
其他好文 时间:
2014-08-31 20:07:21
阅读次数:
359
refer from :http://explainextended.com/2009/07/16/inner-join-vs-cross-apply/INNER JOINis the most used construct inSQL: it joins two tables together, ...
分类:
移动开发 时间:
2014-08-31 18:29:51
阅读次数:
158
---恢复内容开始---Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lis...
分类:
其他好文 时间:
2014-08-31 17:01:51
阅读次数:
270
UVA 11294 - Wedding
题目链接
题意:有n对夫妻,0号是公主,现在有一些通奸关系(男男,女女也是可能的)然后要求人分配在两侧,夫妻不能坐同一侧,并且公主对面一侧不能有两个同奸的人,问方案
思路:2-set,建图,一共2n个人,设偶数是丈夫,奇数是妻子,左侧为false,右侧为true,然后丈夫妻子建一条true false 或 false true的边,然后然公...
分类:
其他好文 时间:
2014-08-31 13:17:41
阅读次数:
189