码迷,mamicode.com
首页 >  
搜索关键字:two pointers    ( 12138个结果
zoj 1608 Two Circles and a Rectangle 判断两个圆是否能放入一个矩形中
题目来源:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=608分析:两个圆放到矩形的临界点图为:其中a为长, b为宽, r1 > r2红色三角形的三边长分别为:x = a - (r1 +r2)y = b - (r1 + r2)z...
分类:其他好文   时间:2014-05-08 14:17:58    阅读次数:377
Leetcode | Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu...
分类:其他好文   时间:2014-05-08 06:33:29    阅读次数:339
leetcode第一刷_Populating Next Right Pointers in Each Node
这道题之前没见过,一上来还真不知道怎么做。问题的限制条件,树是完全二叉树其实并不是关键,只不过是一个简化的条件而已。那关键是什么呢?如何从当前节点跳到下一个开始的节点。我的做法是,每次从一层的最左边节点开始,一层一层的走。其实只有两种形式的next指针需要我们来更新,第一种,同一个节点的左右孩子,第二种,父亲相邻时,左边父亲的右孩子和右边父亲的左孩子之间。完全二叉树的简化就体现在更新的过程,因为完...
分类:其他好文   时间:2014-05-08 04:02:43    阅读次数:324
POJ2406Power Strings
来源:http://poj.org/problem?id=2406  Power Strings Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 30293   Accepted: 12631 Description Given two strin...
分类:其他好文   时间:2014-05-08 02:03:40    阅读次数:337
AngularJS学习--- AngularJS中数据双向绑定(two-way data-binding) orderBy step4
1.切换工作目录git checkout step-4 #切换分支,切换到第4步npm start #启动项目2.代码app/index.htmlSearch: Sort by: {{phone.name}} {{phone.snippet}} app/controllers....
分类:Web程序   时间:2014-05-07 11:05:47    阅读次数:527
[二分+容斥原理] poj 2773 Happy 2006
题目链接: http://poj.org/problem?id=2773 Happy 2006 Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 9131   Accepted: 3073 Description Two positiv...
分类:移动开发   时间:2014-05-07 02:37:49    阅读次数:435
Leetcode | Populating Next Right Pointers in Each Node I & II
Populating Next Right Pointers in Each Node IGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLin...
分类:其他好文   时间:2014-05-07 01:34:51    阅读次数:407
Merge Two Sorted Lists
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fir...
分类:其他好文   时间:2014-05-06 23:54:10    阅读次数:469
CareerCup之1.4判断字符串是否为变位词
【题目】 原文: 1.4 Write a method to decide if two strings are anagrams or not. 译文: 写一个函数判断两个字符串是否是变位词。 【分析】 变位词(anagrams)指的是组成两个单词的字符相同,但位置不同的单词。比如说, abbcd和abcdb就是一对变位词。该题目有两种思路: 【思路一】 由于变位词只是字...
分类:其他好文   时间:2014-05-06 23:17:56    阅读次数:383
codechef Row and Column Operations 题解
You are given an N × N grid initially filled by zeros. Let the rows and columns of the grid be numbered from1 to N, inclusive. There are two types of operations can be applied to the grid: RowAdd R...
分类:其他好文   时间:2014-05-06 22:35:44    阅读次数:451
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!