码迷,mamicode.com
首页 >  
搜索关键字:nth node    ( 28024个结果
搜索算法思考
概述:本文主要讲述一些搜索算法的使用,以及其中奥妙思想的思考。 一:广度搜索与深度搜索---BFS与DFS 1:实现算法导论中的BSF #include #define MAX 1000000struct Node{ int d; int p; int color; int id;};int _tm...
分类:其他好文   时间:2014-07-16 23:08:16    阅读次数:224
闲来无事爬了下通讯录 试手 jsdom
curl http://xxx.com/address/addresslist\?search\=%40 --cookie oa_cookie=123 -s| node parss.js js 代码var jsdom = require('jsdom') ,fs = require('fs...
分类:Web程序   时间:2014-07-10 13:58:50    阅读次数:161
Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 ...
分类:其他好文   时间:2014-07-10 11:24:15    阅读次数:229
避免多层回调,Node.js异步库Async使用(series)
未使用Async之前coffeescript写的代码:exports.product_file_add = (req,res) -> if !req.param('file_id') return res.json({'flag':'error','msg':'请先上传文件再保存!'}) ...
分类:Web程序   时间:2014-07-10 10:16:14    阅读次数:773
单链表
表的实现:数组:可以用动态数组实现,但是,删除和插入的开销太大。链表:由内存中一系列不相连的结构连成;每个结构含有表元素和指向下一个结构的指针;链表的实现: ps:为了方便删除和插入,我们设置一个头节点;节点:包含一个元素和指向下一个节点的指针;1 struct Node{2 int E...
分类:其他好文   时间:2014-07-09 23:59:48    阅读次数:401
栈---链表实现
栈:是一种后进先出(LIFO)的结构,对其插入删除只能在栈顶进行;链表实现节点:#include#includetypedef struct Node *PtrToNode;typedef PtrToNode Stack;struct Node{ int Element; struct No...
分类:其他好文   时间:2014-07-07 23:48:05    阅读次数:224
LeetCode OJ - Remove Nth Node From End of List
题目:Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2.After rem...
分类:其他好文   时间:2014-07-07 19:01:42    阅读次数:155
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 separa...
分类:其他好文   时间:2014-06-30 09:01:23    阅读次数:197
搭建pomelo的聊天示例
昨晚,把pomelo的聊天示例搭建到公网了,感觉还是有很多坑,记录一下。先上最后的效果图。 体验地址:http://chat.xiaodao.co/ 搭建步骤: 准备一个有公网IP的机子,我用的是Linode 1024的Ubuntu 14.04 LTS。 这里按照我的机子IP:178.79.185.180,和我的安装目录/opt来讲,你...
分类:其他好文   时间:2014-06-30 06:26:28    阅读次数:287
LeetCode: Linked List Cycle II [142]
【题目】 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? 【题意】 给定一个单向链表,如果链表有环,则返回环开始的位置。 【思路】 仍然是维护两个指针, p1, p2, p1每次走一步, p2每次走两步 ...
分类:其他好文   时间:2014-06-29 23:59:21    阅读次数:354
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!