码迷,mamicode.com
首页 >  
搜索关键字:add two numbers    ( 52886个结果
Linux下git基本使用总结<1>
1.安装 Linux下直接apt-get install git 或者 apt-get install git-core 即可   2.创建版本库 进入目录 git init 此时会生成一个.git的目录,用来管理你的这个目录下的版本,一般不要动.git目录。   3.添加文件,并提交 git add  filename                          可以看作将文...
分类:系统相关   时间:2014-05-23 08:14:08    阅读次数:374
【LeetCode】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 it as a link...
分类:其他好文   时间:2014-05-23 07:43:23    阅读次数:246
JDK源码分析—— ArrayBlockingQueue 和 LinkedBlockingQueue
目的:本文通过分析JDK源码来对比ArrayBlockingQueue 和LinkedBlockingQueue,以便日后灵活使用。 1. 在Java的Concurrent包中,添加了阻塞队列BlockingQueue,用于多线程编程。BlockingQueue的核心方法有: * boolean add(E e) ,把 e 添加到BlockingQueue里。如果BlockingQueue可以容纳,则返回true,否则抛出异常。 * boolean offer(E e),表示如果可能的话,将 e 加...
分类:数据库   时间:2014-05-22 12:19:23    阅读次数:442
UVA 11481 - Arrange the Numbers(组合数学)
题目链接:11481 - Arrange the Numbers 题意:序列1-n,进行重排,问最后前m个中有k个仍然位置不变的情况数 思路:之前写过UVA 580, n个数重排,要求每个位置都不同的情况的题目,递推式为dp[i] = (i - 1) * (dp[i - 1] + dp[i - 2]) 利用这个,这题只要: k个位置C(m, k) * sum(C[n - m][i] (后面...
分类:其他好文   时间:2014-05-22 10:45:52    阅读次数:191
poj 2082 Terrible Sets (数据结构 ——栈 STL)
?? Terrible Sets Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 2999   Accepted: 1549 Description Let N be the set of all natural numbers {0 , 1 , 2 , . . . ...
分类:其他好文   时间:2014-05-22 09:52:10    阅读次数:283
LeetCode: Sudoku Solver [036]
【题目】 Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character '.'. You may assume that there will be only one unique solution. A sudoku puzzle... ...and its solution numbers marked in red. ...
分类:其他好文   时间:2014-05-20 17:07:34    阅读次数:335
UVA 12123 - Magnetic Train Tracks(计数问题)
题目链接:12123 - Magnetic Train Tracks 题意:给定n个点,求有几个锐角三角形。 思路:和UVA 11529是同类的题,枚举一个做原点,然后剩下点根据这个原点进行极角排序,然后利用two pointer去遍历一遍,找出角度小于90度的锐角,然后扣掉这些得到钝角三角形的个数,然后在用总情况去扣掉钝角就是锐角或直角 代码: #include #include #...
分类:Web程序   时间:2014-05-20 14:10:56    阅读次数:412
Leetcode:Same Tree
戳我去解题Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identic...
分类:其他好文   时间:2014-05-20 10:09:37    阅读次数:201
用 Python 替代 Bash 脚本(转)
add by zhj: 其实作者是想说用Python来做那些Bash实现起来比较麻烦的部分,即将Bash与Python结合使用。英文原文:http://www.linuxjournal.com/content/python-scripts-replacement-bash-utility-scrip...
分类:编程语言   时间:2014-05-20 08:53:25    阅读次数:735
Leetcode:Merge Two Sorted Lists
戳我去解题Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.分析:直...
分类:其他好文   时间:2014-05-20 08:52:09    阅读次数:277
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!