码迷,mamicode.com
首页 >  
搜索关键字:median of two sorted    ( 17004个结果
Combinations [leetcode]
描述: 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
Configure task switcher in KDE
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
poj 3349:Snowflake Snow Snowflakes(哈希查找,求和取余法+拉链法)
Snowflake Snow SnowflakesTime Limit:4000MSMemory Limit:65536KTotal Submissions:30529Accepted:8033DescriptionYou may have heard that no two snowflakes ...
分类:其他好文   时间:2014-07-15 09:27:32    阅读次数:231
[leetcode]Two Sum
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
Add Two Numbers
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
Same Tree
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
LeetCode——Best Time to Buy and Sell Stock III
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
[ACM] POJ 3349 Snowflake Snow Snowflakes(哈希查找,链式解决冲突)
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!