码迷,mamicode.com
首页 >  
搜索关键字:maximum likelihood    ( 4167个结果
Max Points on a Line (Python)
【问题】 Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 【思路】 对每一个点,分别计算这个点和其他所有点构成的斜率,具有相同斜率最多的点所构成的直线,就是具有最多点的直线。 【代码】 class Point: def __in...
分类:编程语言   时间:2014-06-25 19:34:29    阅读次数:246
LeetCode Maximum Depth of Binary Tree
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:其他好文   时间:2014-06-25 18:40:08    阅读次数:182
图像处理---灰度处理(黑白效果)
转自:图像处理:黑白效果(灰度处理)1.效果图:2.实现原理:图像灰度化就是使色彩的三种颜色分量R、G、B的值相同,由于颜色值的取值范围是[0,255],所以灰度的 级别只有256种,即灰度图象仅能表现256种灰度颜色,常用有3种处理方法:*最大值法(Maximum):R=G=B=Max(R,G,B...
分类:其他好文   时间:2014-06-25 17:53:20    阅读次数:420
LeetCode: Best Time to Buy and Sell Stock III [123]
【题目】 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 may not engage in multiple transactions at the same time (i...
分类:其他好文   时间:2014-06-24 23:28:43    阅读次数:223
LeetCode: Binary Tree Maximum Path Sum [124]
【题目】 Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For example: Given the below binary tree, 1 / 2 3 Return 6. 【题意】 给定一棵二叉树,找出其中路径和最大的路径,然会返回最大路径和。 本题中的路径不是从根节点到叶子节点这样的传统的路...
分类:其他好文   时间:2014-06-24 20:42:59    阅读次数:268
LeetCode: Best Time to Buy and Sell Stock II [122]
【题目】 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 as many transactions as you like (ie, buy one and sell one share of the stock multiple times). H...
分类:其他好文   时间:2014-06-24 19:40:53    阅读次数:240
Longest Palindromic Substring
题目 Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 方法 ...
分类:其他好文   时间:2014-06-24 19:36:55    阅读次数:212
Python递归报错:RuntimeError: maximum recursion depth exceeded in comparison
Python中默认的最大递归深度是989,当尝试递归第990时便出现递归深度超限的错误:RuntimeError: maximum recursion depth exceeded in comparison简单方法是使用阶乘重现: 1 #! /usr/bin/env Python 2 3 def....
分类:编程语言   时间:2014-06-23 07:40:27    阅读次数:298
Light OJ 1272 Maximum Subset Sum 高斯消元 最大XOR值
题目来源:Light OJ 1272 Maximum Subset Sum 题意:选出一些数 他们的抑或之后的值最大 思路:每个数为一个方程 高斯消元 从最高位求出上三角 消元前k个a[i]异或和都能有消元后的异或和组成 消元前 k 个 a[i] a[i]异或和都能有消元后的 异或和都能有消元后的 p 个 a[i] a[i]的异或 的异或 保证每一列只有一个1 消元...
分类:其他好文   时间:2014-06-22 16:58:09    阅读次数:231
include/linux/tasks.h
#ifndef _LINUX_TASKS_H#define _LINUX_TASKS_H/** This is the maximum nr of tasks - change it if you need to*///最大的进程数量#define NR_TASKS 128#endif
分类:系统相关   时间:2014-06-20 17:29:36    阅读次数:290
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!