描述: Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2...
分类:
其他好文 时间:
2014-07-16 19:29:31
阅读次数:
166
Task switcher in KDE is used to configure the behavior for navigating through windows. It has two modes, main and alternative. By default, the task sw...
分类:
其他好文 时间:
2014-07-15 23:29:00
阅读次数:
379
Snowflake Snow SnowflakesTime Limit:4000MSMemory Limit:65536KTotal Submissions:30529Accepted:8033DescriptionYou may have heard that no two snowflakes ...
分类:
其他好文 时间:
2014-07-15 09:27:32
阅读次数:
231
Two SumGiven an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the...
分类:
其他好文 时间:
2014-07-15 08:45:17
阅读次数:
236
今天做了Leetcode上面一道题Remove Duplicates from Sorted List II,要去去除链表中重复的节点,代码如下 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * ...
分类:
其他好文 时间:
2014-07-13 21:23:10
阅读次数:
160
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-07-13 18:20:52
阅读次数:
202
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 and the nodes have the same value.
/**
* Defin...
分类:
其他好文 时间:
2014-07-13 15:50:25
阅读次数:
158
比如在插入有序链表的过程中,一般情况下要使用俩指针来遍历,而后还要判断是否在第一个位置插入;利用指针的指针后不需要另外考虑这种特殊情况。
代码:
#include
#include
struct node{
int data;
struct node *next;
} *head;
//sorted link-list
void insert(struct no...
分类:
其他好文 时间:
2014-07-13 15:38:13
阅读次数:
198
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete at most two transactions.
Note:
You ma...
分类:
其他好文 时间:
2014-07-13 13:55:14
阅读次数:
305
Snowflake Snow Snowflakes
Time Limit: 4000MS
Memory Limit: 65536K
Total Submissions: 30512
Accepted: 8024
Description
You may have heard that no two snowflakes are al...
分类:
其他好文 时间:
2014-07-13 13:45:20
阅读次数:
235