码迷,mamicode.com
首页 >  
搜索关键字:swap nodes in pairs    ( 8848个结果
ACDream - Xor pairs
先上题目:Xor pairsTime Limit:2000/1000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others)SubmitStatusProblem Descriptionlong long ans = 0;for(int i ...
分类:其他好文   时间:2014-08-01 04:35:00    阅读次数:246
Leetcode 线性表 Swap Nodes in Pairs
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlieSwap Nodes in PairsTotal Accepted:12511Total Submissions:39302Given a linked list, swap every two...
分类:其他好文   时间:2014-07-31 23:26:40    阅读次数:307
[leetcode]Maximum Depth of Binary Tree
Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root ...
分类:其他好文   时间:2014-07-31 23:19:10    阅读次数:259
Leetcode--Add Two Numbers
Problem Description: 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 numbe...
分类:其他好文   时间:2014-07-31 20:47:17    阅读次数:215
最小化Linux系统安装
安装CentOS 5.9基于vbox虚拟机,虚拟机内存1 G,虚拟硬盘大小8 G虚拟网卡使用host only方式创建卷组centos独立的boot分区home, root和swap分区皆是卷组centos的逻辑卷保持boot,home,root和swap大小合理关闭selinux关闭防火墙最小化安...
分类:系统相关   时间:2014-07-31 20:41:37    阅读次数:335
HDU - 1394 Minimum Inversion Number (线段树求逆序数)
Description The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj. For a given sequence of numbers a1, a2, ..., an, if we move the ...
分类:其他好文   时间:2014-07-31 13:31:46    阅读次数:229
Maximum Depth of Binary Tree leetcode java
题目:Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthes....
分类:编程语言   时间:2014-07-31 02:41:15    阅读次数:229
Minimum Depth of Binary Tree leetcode java
题目:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the neares....
分类:编程语言   时间:2014-07-31 02:30:25    阅读次数:264
四种变量交换swap方法
1.void swap(int &x, int &y){            int...
分类:其他好文   时间:2014-07-30 20:47:34    阅读次数:261
codeforces159D - Palindrome pairs 二重DP
题意:给你一个字符串,问你其中不重叠的回文字串对有多少解题思路:这题用到两种方法,不过其实是一个很巧妙的二重dp1)暴力求解以i开头,j结尾的是否为回文,如果是,ans += sum[i-1](ans 为答案, sum[i]为在 1 - i内回文串的个数--需要dp求解)这里非常耗时,时间大约为 n...
分类:其他好文   时间:2014-07-30 20:05:44    阅读次数:276
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!