码迷,mamicode.com
首页 >  
搜索关键字:swap nodes in pairs    ( 8848个结果
[LeetCode]Binary Tree Postorder Traversal
【题目】 Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [3,2,1]. Note: Recursi...
分类:其他好文   时间:2014-12-07 17:49:21    阅读次数:135
【 D3.js 进阶系列 — 3.2 】 分区图的函数
分区图的布局比较简单,本章介绍一下分区图的参数。分区图布局为:d3.layout.partition()其函数有6个。nodes()将根数据传入后,得到的节点的数组,每个节点添加8个参数:parent - 父节点children - 子节点value - 表示节点的大小,由下面 value() 函数指定的值,父节点的值等于子节点值的和depth - 节点的深度x - 节点的x方向的坐标(不一定指x...
分类:Web程序   时间:2014-12-07 16:30:16    阅读次数:237
冒泡排序,选择排序,插入排序的区别
#include int swap(int *a,int *b) { int t=*a; *a=*b; *b=t; } /* 冒泡排序的原理:每次在无序队列里将相邻两个数依次进行比较,将小数调换到前面, 逐次比较,直至将最大的数移到最后。最将剩下的N-1个数继续比较,将次大数移至倒数第二位。 依此规律,直至比较结束。 冒泡排序的代码如下: */ void ...
分类:编程语言   时间:2014-12-07 15:05:38    阅读次数:201
LeetCode: Merge Two Sorted Lists 解题报告
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fir...
分类:其他好文   时间:2014-12-07 14:58:26    阅读次数:178
进程管理三大扩展工具htop
三大进程管理监控工具HTOP介绍:Htop是一款运行于Linux系统监控与进程管理软件,htop提供所有进程的列表,并且使用彩色标识出处理器、swap和内存状态。用户一般可以在top无法提供详尽系统信息的情况下选择安装并使用htop。与top相比,htop提供更方便、光标控制的界面来杀死进程..
分类:系统相关   时间:2014-12-07 11:23:29    阅读次数:300
【LeetCode】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. 解答 注意假的头结点的运用,代码如下: /** * Definition for singly-...
分类:其他好文   时间:2014-12-06 16:51:45    阅读次数:195
【LeetCode】Remove Duplicates from Sorted List II
Remove Duplicates from Sorted List IIGiven a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the or...
分类:其他好文   时间:2014-12-06 16:48:45    阅读次数:170
careercup-树与图 4.7
4.7 设计并实现一个算法,找出二叉树中某两个结点的第一个共同祖先。不得将额外的结点储存在另外的数据结构中。注意:这不一定是二叉查找树。解答本题的关键应当是在Avoid storing additional nodes in a data structure 这句话上。我的理解是,不允许开额外的空间...
分类:其他好文   时间:2014-12-06 15:18:05    阅读次数:253
leetcode. 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-12-06 12:47:15    阅读次数:152
leetcode. Reorder List
Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For exam...
分类:其他好文   时间:2014-12-06 11:18:15    阅读次数:163
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!