码迷,mamicode.com
首页 >  
搜索关键字:same    ( 2737个结果
【Leetcode】Max Points on a Line
Givennpoints on a 2D plane, find the maximum number of points that lie on the same straight line.每次固定一个点,然后遍历所有其它点,记录每种斜率出现的次数。需要考虑两种特殊情况:斜率不存在和点与固定点重...
分类:其他好文   时间:2014-06-10 08:44:57    阅读次数:164
Sort Colors
题目 Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the...
分类:其他好文   时间:2014-06-10 07:21:21    阅读次数:261
GPS-Graph Processing System Graph Coloring算法分析 (三)
Graph coloring is the problem of assigning a color to each vertex of an undirected graph such that no two adjacent vertices have the same color. We implement the greedy algorithm from Scalable parallel graph coloring algorithms. The algorithm iteratively f...
分类:其他好文   时间:2014-06-10 07:10:19    阅读次数:260
LeetCode:Substring with Concatenation of All Words
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatena...
分类:其他好文   时间:2014-06-09 17:49:34    阅读次数:240
[leetcode] 22.Same Tree
同是递归简单题public class Solution { public boolean isSameTree(TreeNode p, TreeNode q) { boolean flag = true; if(p == null && q == null) ...
分类:其他好文   时间:2014-06-09 13:46:23    阅读次数:275
[LeetCode] Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.思路:(1)点1到点n (a)以点1为参考点,求“点1”与“点2到点n”各个斜率下点的个数; (求出直...
分类:其他好文   时间:2014-06-08 22:30:56    阅读次数:266
[LeetCode OJ] Max Points on a Line—Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
//定义二维平面上的点struct Point{ int x; int y; Point(int a=0, int b=0):x(a),y(b){}};bool operator==(const Point& left, const Point& right){ return...
分类:其他好文   时间:2014-06-08 22:26:17    阅读次数:357
[leetcode]Sort Colors @ Python
原题地址:https://oj.leetcode.com/problems/sort-colors/题意:Given an array withnobjects colored red, white or blue, sort them so that objects of the same col...
分类:编程语言   时间:2014-06-08 20:56:32    阅读次数:394
jsonp突破同源策略,实现跨域访问请求
跨域访问问题,相信大家都有遇到过。这是一个很棘手的问题。不过道高一尺,魔高一丈,对于这类问题,总有解决问题的方案。最近我又接触到了这个问题,解决的途径是ajax+jsonp。 说到这个问题,不得不说一下“同源策略(Same-Origin Policy)”,它是由Netscape提出的一个著名的安全策略。现在所有支持JavaScript 的浏览器都会使用这个策略。所谓同源,就是必须协议、域名、端口都一致的,才叫做同源。例如:http://www.12306.cn和https://www.1230...
分类:Web程序   时间:2014-06-08 16:41:57    阅读次数:308
fork() in linux
About fork() in linux:parent/child processes created by fork() share the same file table (linux file descriptor or called `open file descriptor`)Which...
分类:系统相关   时间:2014-06-07 21:47:58    阅读次数:443
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!