码迷,mamicode.com
首页 >  
搜索关键字:median of two sorted    ( 17004个结果
leetcode(14)-合并k个排序链表
合并?k?个排序链表,返回合并后的排序链表。请分析和描述算法的复杂度。 示例: 链接:https://leetcode cn.com/problems/merge k sorted lists 自己的思路 在k个链表中找到一个比较节点,然后把k个链表分成两部分,一部分都比比较节点小,一部分都比比较节 ...
分类:编程语言   时间:2020-01-04 16:17:48    阅读次数:90
[LC] 572. Subtree of Another Tree
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a ...
分类:其他好文   时间:2020-01-04 14:40:32    阅读次数:74
[LC] 404. Sum of Left Leaves
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 ...
分类:其他好文   时间:2020-01-04 14:37:15    阅读次数:81
[List] Some Interesting Problems about Games
ABC059D "Alice & Brown" In this game, there are two piles initially consisting of $X$ and $Y$ stones, respectively. Alice and Brown alternately perfor ...
分类:其他好文   时间:2020-01-04 01:17:34    阅读次数:62
leetcode 215. Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example ...
分类:其他好文   时间:2020-01-03 21:27:13    阅读次数:104
LeetCode-Medium-Add Two Number
###Add Two Number本来是一道非常简单的题目原题目的意思是,给两个链表,两个链表都链尾是十进制的头部例如有链表形式 9->8->7 对应的十进制就是789,而后的操作时将两个链表相加并且合并到一个链表里面 ###第一次的解法我第一次是被结构体卡住了,才考研完,很多基础知识全忘了,比如构 ...
分类:其他好文   时间:2020-01-03 21:04:15    阅读次数:79
Groovy 字符串那点儿事儿
可以直接用+ assert 'ab' == 'a' + 'b' 支持多行 def aMultilineString = '''line one line two line three''' out: Fri Jan 03 11:14:58 CST 2020: INFO: line oneline t ...
分类:其他好文   时间:2020-01-03 12:11:58    阅读次数:105
图的Prim,Kruskal,Dijkstra,Floyd算法
代码部分有点问题,具体算法没问题, 最近期末考,要过段时间才会修改 //邻接矩阵,具体情况看上一篇的图的实现template<class T>class MGraph {public: MGraph(T a[], int n, int e); void DFS(int v); void BFS(in ...
分类:编程语言   时间:2020-01-03 09:12:23    阅读次数:70
第二次电话面试
坐标:北京 百度 地图内容生态部_推荐算法实习生 http://collabedit.com 如果i=5;那么 a=(++i)--;之后,a和i的值各是多少构造函数和析构函数必须要使用初始化列表 Python 列表和元组有什么不同? a = 0.1b = 0.2c = 0.3a + b == c a ...
分类:其他好文   时间:2020-01-02 18:42:39    阅读次数:83
LeetCode - 176. 第二高的薪水
题目 来源:力扣(LeetCode) 描述 我们提供了一个类: 三个不同的线程将会共用一个 Foo 实例。 线程 A 将会调用 one() 方法 线程 B 将会调用 two() 方法 线程 C 将会调用 three() 方法 请设计修改程序,以确保 two() 方法在 one() 方法之后被执行,t ...
分类:其他好文   时间:2020-01-02 15:40:57    阅读次数:90
17004条   上一页 1 ... 98 99 100 101 102 ... 1701 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!