码迷,mamicode.com
首页 >  
搜索关键字:swap nodes in pairs    ( 8848个结果
【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 linked list. Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) Outpu...
分类:其他好文   时间:2014-08-10 13:08:30    阅读次数:296
leetcode 刷题之路 63 Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). zigzag层序遍历树 For example: Given binary...
分类:其他好文   时间:2014-08-09 23:19:59    阅读次数:363
[平衡树学习笔记]那些你所不知道的鬼畜写法
treap: (Orz fhq 大神,我曾经以为我会了 treap ,就再也不会写 splay 了,然后我遇上了 lct ) 1 #include 2 const int sizeOfMemory=10000; 3 template inline void swap(type & x, type.....
分类:其他好文   时间:2014-08-09 21:10:49    阅读次数:302
Minimum Inversion Number
Problem 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 t...
分类:其他好文   时间:2014-08-09 18:48:38    阅读次数:241
VMware 虚拟机Red Hat 5.9 交换区及硬盘空间调整
首先要通过VMware设置简单实现内存扩大。但是系统中的/swap应该如何设置呢?1.创建swap文件使用如下命令: #ddif=/dev/zeroof=/swap/swapfilebs=1Mcount=3072dd命令作用是用指定大小的块拷贝一个文件,并在拷贝同时进行指定的转换。语法:dd[选项....
分类:其他好文   时间:2014-08-09 18:24:58    阅读次数:739
C++学习笔记之模板(1)——从函数重载到函数模板
一、函数重载因为函数重载比较容易理解,并且非常有助于我们理解函数模板的意义,所以这里我们先来用一个经典的例子展示为什么要使用函数重载,这比读文字定义有效的多。现在我们编写一个交换两个int变量值得函数,可以这样写:1 void swap(int & a, int & b)2 {3 int tm...
分类:编程语言   时间:2014-08-09 13:20:57    阅读次数:283
字符串排列组合问题
一.全排列无重复字符#include#includechar buf[1024];void func(int index);void swap(int index1,int index2);int main(){ memset(buf,0,sizeof(buf)); sprintf(bu...
分类:其他好文   时间:2014-08-09 13:14:27    阅读次数:270
[leetcode]Binary Tree Postorder Traversal
Binary Tree Postorder TraversalGiven a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \...
分类:其他好文   时间:2014-08-08 23:58:26    阅读次数:485
[leetcode]Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal IIGiven a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level...
分类:其他好文   时间:2014-08-08 23:53:16    阅读次数:221
零散知识点
1.引用传递参数ref static void Main(string[] args) { int n1 = 10, n2 = 20; Swap(ref n1,ref n2); Console.WriteL...
分类:其他好文   时间:2014-08-08 23:52:36    阅读次数:439
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!