码迷,mamicode.com
首页 >  
搜索关键字:swap nodes in pairs    ( 8848个结果
Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o...
分类:其他好文   时间:2014-10-26 15:30:30    阅读次数:159
【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...
分类:其他好文   时间:2014-10-26 14:21:29    阅读次数:243
交换两个变量的值
有两个变量 a 和 b ,交换这两个变量的值方法一 使用中间变量void swap(int *a, int *b){ int temp = 0; temp = *a; *a = *b; *b = temp; }方法二 不适用任何中间变量 ① 异或运算法void swap...
分类:其他好文   时间:2014-10-26 13:05:02    阅读次数:149
Maximum Depth of Binary Tree 二叉树的最大深度
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 farthest le...
分类:其他好文   时间:2014-10-26 07:58:51    阅读次数:161
Binary Tree Level Order Traversal 二叉树层序遍历
Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2...
分类:其他好文   时间:2014-10-26 06:48:34    阅读次数:188
Binary Tree Level Order Traversal II 二叉树层序遍历之二
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:其他好文   时间:2014-10-26 06:47:17    阅读次数:187
【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 identical and the nodes have the same value....
分类:其他好文   时间:2014-10-25 23:09:06    阅读次数:447
【LeetCode】 Maximum Depth of Binary Tree
题目 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 farthest leaf node....
分类:其他好文   时间:2014-10-25 18:50:01    阅读次数:137
C++与C的区别:传值,传址,传引用
贴段代码先 1 void c_swap(int *a, int *b) 2 { 3 *a = *a ^ *b; 4 *b = *a ^ *b; 5 *a = *a ^ *b; 6 } 7 8 void swap(int &a, int &b) 9 {10 a = a...
分类:编程语言   时间:2014-10-25 18:42:06    阅读次数:174
Partition List
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
分类:其他好文   时间:2014-10-25 15:47:52    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!