码迷,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 ...
分类:其他好文   时间:2014-08-05 00:51:58    阅读次数:257
[LeetCode] Binary Tree Zigzag Level Order Traversal(bfs)
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 ...
分类:其他好文   时间:2014-08-05 00:18:28    阅读次数:225
leetcode-Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of...
分类:其他好文   时间:2014-08-03 23:28:56    阅读次数:261
linux环境搭建
一、linux安装 这次学习使用 vmware workstation,安装ubuntu-12.10-desktop。 ubuntu系统的图形界面还是很亲民的~ 具体安装就不在一一介绍了.....二、linux目录结构 linux必要分区 1、根分区 / 2、swap 分区 ...
分类:系统相关   时间:2014-08-03 17:58:55    阅读次数:265
[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-08-03 12:54:55    阅读次数:201
POJ2309 BST
Consider an infinite full binary search tree (see the figure below), the numbers in the nodes are 1, 2, 3, .... In a subtree whose root node is X, we can get the minimum number in this subtree by repe...
分类:其他好文   时间:2014-08-03 12:49:15    阅读次数:229
磁盘分区和挂载
实验目标为虚拟机添加一块80GB、SCSI接口的硬盘划分2个20GB的主分区,剩余作为扩展分区新建2个逻辑分区,分别为2GB、10GB将第1个逻辑分区的类型改为SWAP(ID82)将第2个逻辑分区的类型改为VFAT(IDb)确认分区无误后,保存退出使用partprobe识别新的分区表【最好是重启一次】1...
分类:其他好文   时间:2014-08-03 07:56:55    阅读次数:315
[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. /** * Definition for binary tree ...
分类:其他好文   时间:2014-08-02 23:32:04    阅读次数:232
Swap Nodes in Pairs
问题:交换相邻的两个结点分析:建立新链表每次插入ret->next后在插入ret,需要在判断下若最后只有一个结点不需要交换,注意每次交换了结点要把尾结点的下一个指向空class Solution {public: ListNode *swapPairs(ListNode *head) { ...
分类:其他好文   时间:2014-08-02 18:16:13    阅读次数:178
hdu2819Swap (行列匹配,输出交换路径)
Swap Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1453 Accepted Submission(s): 491 Special Judge Problem Description Given an N*N matrix...
分类:其他好文   时间:2014-08-02 15:37:23    阅读次数:225
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!