码迷,mamicode.com
首页 >  
搜索关键字:two points    ( 13225个结果
LeetCode 28 Divide Two Integers
Divide two integers without using multiplication, division and mod operator. 思路:1.先将被除数和除数转化为long的非负数,注意一定要为long,因为Integer.MIN_VALUE的绝对值超出了Integer的范围。           2.常理:任何正整数num都可以表示为num=2^a+2^b+2^c+.....
分类:其他好文   时间:2014-06-25 19:46:17    阅读次数:246
Peterson和多线程版本
Peterson's algorithm (AKA Peterson's solution) is a concurrent programming algorithm for mutual exclusion that allows two processes to share a single-use resource without conflict, using only shar...
分类:编程语言   时间:2014-06-25 19:38:19    阅读次数:748
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
TJU 4087. box
题目:Tuhao and his two small partners participated in the tournament.But in the end, they lost the chance to finish a mathematical problem.After the com...
分类:其他好文   时间:2014-06-25 18:07:35    阅读次数:333
[LeetCode] Median of Two Sorted Arrays
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ...
分类:其他好文   时间:2014-06-25 14:58:16    阅读次数:210
capwap学习笔记——初识capwap(一)
2 初识CAPWAP 2.1 CAPWAP简介 说了半天CAPWAP,连全称都还没说,汗…… CAPWAP——Control And Provisioning of Wireless Access Points Protocol Specification。其由两个部分组成:CAPWAP协议和无线B...
分类:其他好文   时间:2014-06-25 13:02:19    阅读次数:178
vtk读取文件中点坐标[转]
vtk基础编程(2)-读取数据文件中的坐标点1. 案例说明在实际计算中,常常需要大量的数据, 这个时候数据文件就必不可少, 例如数据文件points.dat, 中存放了三个点的坐标,0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 0.0 1.0 1.0 0.0读取坐标文件最简单的方法...
分类:其他好文   时间:2014-06-25 00:57:39    阅读次数:208
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
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...
分类:其他好文   时间:2014-06-24 21:46:24    阅读次数:249
Container With Most Water
题目 Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (...
分类:其他好文   时间:2014-06-24 16:00:49    阅读次数:220
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!