上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 36 下一页
CS 312 Lecture 25Splay TreesA splay tree is an efficient implementation of a balancedbinary search tree that takesadvantage of locality in the keys used in incoming lookup requests.For many applications, there is excellent key locality.A good example is anetwork router. A network router receives net Read More
posted @ 2013-04-12 10:55 godjob Views(315) Comments(0) Diggs(0) Edit
netcat是网络工具中的瑞士军刀,它能通过TCP和UDP在网络中读写数据。通过与其他工具结合和重定向,你可以在脚本中以多种方式使用它。使用netcat命令所能完成的事情令人惊讶。netcat所做的就是在两台电脑之间建立链接并返回两个数据流,在这之后所能做的事就看你的想像力了。你能建立一个服务器,传输文件,与朋友聊天,传输流媒体或者用它作为其它协议的独立客户端。下面是一些使用netcat的例子.[A(172.31.100.7) B(172.31.100.23)]Linux netcat 命令实例:1,端口扫描端口扫描经常被系统管理员和黑客用来发现在一些机器上开放的端口,帮助他们识别系统中的漏洞 Read More
posted @ 2013-04-11 16:19 godjob Views(168) Comments(0) Diggs(0) Edit
1、常见数据结构线性:数组,链表,队列,堆栈,块状数组(数组+链表),hash表,双端队列,位图(bitmap)树:堆(大顶堆、小顶堆),trie树(字母树or字典树),后缀树,后缀树组,二叉排序/查找树,B+/B-,AVL树,Treap,红黑树,splay树,线段树,树状数组图:图其它:并查集2、常见算法(1) 基本思想:枚举,递归,分治,模拟,贪心,动态规划,剪枝,回溯(2) 图算法:深度优先遍历与广度优先遍历, 最短路径,最小生成树,拓扑排序(3) 字符串算法:字符串查找,hash算法,KMP算法(4) 排序算法:冒泡,插入,选择,快排,归并排序,堆排序,桶排序(5) 动态规划:背包问题 Read More
posted @ 2013-04-10 23:07 godjob Views(200) Comments(0) Diggs(0) Edit
开篇我先给出一个外国的splay tree的演示demo,跟着这个demo看下面的文章对你理解splay tree 有很大的帮助,并且里面有实现好的C语言版和java版 的splay tree(网站中输入节点个数会自动生成树,可以对其任意造作)网站衔接:http://www.link.cs.cmu.edu/cgi-bin/splay/splay-cgi.pl一、简介:伸展树,或者叫自适应查找树,是一种用于保存有序集合的简单高效的数据结构。伸展树实质上是一个二叉查找树。允许查找,插入,删除,删除最小,删除最大,分割,合并等许多操作,这些操作的时间复杂度为O(logN)。由于伸展树可以适应需求序列 Read More
posted @ 2013-04-10 22:47 godjob Views(1767) Comments(0) Diggs(0) Edit
/* For sockaddr_in */#include <netinet/in.h>/* For socket functions */#include <sys/socket.h>/* For gethostbyname */#include <netdb.h>#include <unistd.h>#include <string.h>#include <stdio.h>int main(int c, char **v){ const char query[] = "GET / HTTP/1.0\r\n&q Read More
posted @ 2013-04-01 23:16 godjob Views(167) Comments(0) Diggs(0) Edit
#include "stdafx.h"#include <stl_h.hpp>#include <CInitSocket.hpp>#include <winsock2.h>#include <ws2tcpip.h>#pragma comment(lib,"ws2_32.lib")CInitSocket init;using namespace std;int main(int argc, char **argv){ char *ptr,**pptr; struct hostent *hptr; char s Read More
posted @ 2013-04-01 23:08 godjob Views(249) Comments(0) Diggs(0) Edit
一、Libevent简介 libevent是一个基于事件触发的网络库,适用于windows、linux、bsd等多种平台,内部使用select、epoll、kqueue等系统调用管理事件机制。官网:http://libevent.org/特点:事件驱动,高性能;轻量级,专注于网络,不如ACE那么臃肿... Read More
posted @ 2013-03-31 23:29 godjob Views(982) Comments(0) Diggs(0) Edit
wget是在Linux下开发的开放源代码的软件,作者是Hrvoje Niksic,后来被移植到包括Windows在内的各个平台上。它有以下功能和特点:(1)支持断点下传功能;这一点,也是网络蚂蚁和FlashGet当年最大的卖点,现在,Wget也可以使用此功能,那些网络不是太好的用户可以放心了;(2)同时支持FTP和HTTP下载方式;尽管现在大部分软件可以使用HTTP方式下载,但是,有些时候,仍然需要使用FTP方式下载软件;(3)支持代理服务器;对安全强度很高的系统而言,一般不会将自己的系统直接暴露在互联网上,所以,支持代理是下载软件必须有的功能;(4)设置方便简单;可能,习惯图形界面的用户已经 Read More
posted @ 2013-03-31 21:01 godjob Views(162) Comments(0) Diggs(0) Edit
inux zip命令zip -r myfile.zip ./*将当前目录下的所有文件和文件夹全部压缩成myfile.zip文件,-r表示递归压缩子目录下所有文件.2.unzipunzip -o -d /home/sunny myfile.zip把myfile.zip文件解压到 /home/sunny/-o:不提示的情况下覆盖文件;-d:-d /home/sunny 指明将文件解压缩到/home/sunny目录下;3.其他zip -d myfile.zip smart.txt删除压缩文件中smart.txt文件zip -m myfile.zip ./rpm_info.txt向压缩文件中myfil Read More
posted @ 2013-03-31 20:44 godjob Views(239) Comments(0) Diggs(0) Edit
.tar 解包:tar xvf FileName.tar打包:tar cvf FileName.tar DirName(注:tar是打包,不是压缩!)———————————————.gz解压1:gunzip FileName.gz解压2:gzip -d FileName.gz压缩:gzip FileName.tar.gz 和 .tgz解压:tar zxvf FileName.tar.gz压缩:tar zcvf FileName.tar.gz DirName———————————————.bz2解压1:bzip2 -d FileName.bz2解压2:bunzip2 FileName.bz2压缩 Read More
posted @ 2013-03-31 20:39 godjob Views(125) Comments(0) Diggs(0) Edit
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 36 下一页