码迷,mamicode.com
首页 >  
搜索关键字:nodes    ( 4030个结果
leetcode - Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree {3,9,20,#,#,15,7}, 3 / 9 20 ...
分类:其他好文   时间:2014-09-29 19:55:01    阅读次数:169
[LeetCode]Swap Nodes in Pairs 成对交换
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. Y...
分类:其他好文   时间:2014-09-29 01:40:57    阅读次数:297
线性表之静态链表
#include#include #include"windows.h"using namespace std;struct StaticLinkNode{ int data; int next;};struct StaticLink{ StaticLinkNode* nodes;...
分类:其他好文   时间:2014-09-28 16:13:23    阅读次数:135
leetcode - Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. Y...
分类:其他好文   时间:2014-09-28 14:33:56    阅读次数:178
HDU Tree LCA 2014 ACM/ICPC Asia Regional Shanghai Online
题意: 给定n个点的树,m个操作 树有点权和边权 下面n-1行给出树边 下面m行操作 : ● ADD1 u v k: for nodes on the path from u to v, the value of these nodes increase by k. ● ADD2 u v k: for edges on the path from u to v, the value...
分类:其他好文   时间:2014-09-27 20:30:00    阅读次数:202
leetcode - Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled uniquely. We use # as a separator for ea...
分类:其他好文   时间:2014-09-27 15:16:19    阅读次数:121
链表反向输出
struct ListNode { int m_nKey; ListNode *m_pNext;};void printListReversingly(ListNode *pHead) { stack nodes; ListNode *pNode = pHead; while (pNode != N...
分类:其他好文   时间:2014-09-26 11:42:08    阅读次数:162
RHCS(三)之quorum机制测试(阶段三、四、结论)
阶段三:我们这次试一下非正常退出模拟宕机方法:方法一:虚拟机挂起方法二:echoc>/proc/sysrq-trigger恢复所有节点(略)[root@web1~]#cman_toolstatus……Nodes:4Expectedvotes:8Totalvotes:8Nodevotes:2Quorum:5……=====Step1:对web3节点进行模拟故障=====[root@web1~..
分类:其他好文   时间:2014-09-26 00:15:48    阅读次数:326
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. 1 /** 2 ...
分类:其他好文   时间:2014-09-25 13:02:08    阅读次数:204
leetcode - [7]Binary Tree Preorder Traversal
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].思路:...
分类:其他好文   时间:2014-09-25 03:56:48    阅读次数:215
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!