码迷,mamicode.com
首页 >  
搜索关键字:median of two sor    ( 12209个结果
python 自定义断言
#判断返回结果是否包含预期结果 def is_contain(self,str_one,str_two):#判断str_one是否包含于str_two flag=None try: str_one.index(str_two)>1 except: print('PASS!') ... ...
分类:编程语言   时间:2019-06-09 00:20:52    阅读次数:125
Arrays数组工具类
1、public static String toString(数组),将参数数组变成字符串(按照默认格式) int [] intArray = {10,20,30}; String str = Arrays.toString(intArray); 2、pubblic static void sor ...
分类:编程语言   时间:2019-06-07 22:56:46    阅读次数:105
【LeetCode每天一题】 Intersection of Two Linked Lists(两个链表的入口节点)
Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in ...
分类:其他好文   时间:2019-06-07 21:00:31    阅读次数:114
letecode [100] - Same Tree
Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident ...
分类:其他好文   时间:2019-06-06 21:14:27    阅读次数:89
leetcode-easy-array-50. Intersection of Two Arrays II
mycode 77.78% 参考: 1、应用collection.Counter库,可以实现与运算 2、 ...
分类:其他好文   时间:2019-06-06 15:31:21    阅读次数:79
leetcode-mid-math-29. Divide Two Integers
mycode 91.28% 参考: 思路:其实时不能用除法运算的,但是我还是用了。。。。 这道题的要求是在不使用乘法、除法、取模运算的前提下实现两个整数相除。如果溢出,返回MAX_INT。这道题的直接思路是用被除数不断减去除数,直到为0。这种方法的迭代次数是结果的大小,即比如结果为n,算法复杂度是O ...
分类:其他好文   时间:2019-06-06 09:24:27    阅读次数:90
letecode [67] - Add Binary
Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Example 1 ...
分类:其他好文   时间:2019-06-06 00:35:13    阅读次数:101
python中的*和**的用途
def function_with_one_star(*t): print(t, type(t)) def function_with_two_stars(**d) print(d, type(d))上面定义了两个函数,分别用了带一个星号和两个星号的参数,它们是什么意思,运行下面的代码: funct ...
分类:编程语言   时间:2019-06-06 00:29:03    阅读次数:134
toj 2282: Median Weight Bead (队列+vector)
描述 There are N beads which of the same shape and size, but with different weights. N is an odd number and the beads are labeled as 1, 2, ..., N. Your ...
分类:其他好文   时间:2019-06-05 23:56:08    阅读次数:216
[leetcode]1. Two Sum
class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { int n=nums.size(); int i,j; vector<int> res(2); for (i=0;i<n-1;i++){ for ( ...
分类:其他好文   时间:2019-06-05 23:32:22    阅读次数:117
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!