01 2015 档案
摘要:Implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The...
阅读全文
摘要:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
阅读全文
摘要:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ...
阅读全文
摘要:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are som...
阅读全文
摘要:http://andrew913.iteye.com/blog/398648首先来介绍下apache的一个工具apxs。apxs是一个为Apache HTTP服务器编译和安装扩展模块的工具,用于编译一个或多个源程序或目标代码文件为动态共享对象,使之可以用由mod_so提供的LoadModule指令在...
阅读全文
摘要:The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font fo...
阅读全文
摘要:问题描述:字符序列的子序列是指从给定字符序列中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后所形成的字符序列。令给定的字符序列X=“x0,x1,…,xm-1”,序列Y=“y0,y1,…,yk-1”是X的子序列,存在X的一个严格递增下标序列,使得对所有的j=0,1,…,k-1,有xij=yj...
阅读全文
摘要:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
阅读全文
摘要:首先,演示一个错误的reverList 1 class Solution { 2 public: 3 ListNode* reverse(ListNode* root) 4 { 5 if(NULL == root) 6 ...
阅读全文
摘要:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
阅读全文
摘要:想到的就是排序,把大的放在前面,注意下面的程序,如果数字本身是0,也会加到str中,如果用while(tmp),那么就加不到str中了,这里相当于一个do while,不过个人不喜欢用do while,所以这样写29 while(1)30 {31 ...
阅读全文
摘要:方法一:若是bst,中序便利后一定是有序,递增的。可以中序遍历后查看是否递增来判断 1 class Solution { 2 public: 3 bool isValidBST(TreeNode *root) { 4 5 if...
阅读全文
摘要:dynamic 转换时的类必须有虚函数,否则会编译报错。#include using namespace std;class A{public: int a ; int b; void prt(void){std::cout (pA); cout (rA); cou...
阅读全文
摘要:#include using namespace std;class A{public: int a ; int b; void prt(void){std::cout prt();}因为其为静态绑定,编译时就已经制定了函数的如可地址。输出结果为:> ./a.out prt her...
阅读全文
摘要:#include struct CloneableBase { virtual CloneableBase* clone() const = 0;};templatestruct Cloneable : CloneableBase { virtual CloneableBase* clo...
阅读全文
摘要:http://www.cnblogs.com/zhuyf87/archive/2013/03/12/2955058.html#includeusing namespace std;class CBird{public: CBird() { cout fly(); delete pBird...
阅读全文
摘要:http://www.cnblogs.com/itech/archive/2009/04/10/1433052.html1.Linux链接概念Linux链接分两种,一种被称为硬链接(Hard Link),另一种被称为符号链接(Symbolic Link)。默认情况下,ln命令产生硬链接。【硬连接】硬...
阅读全文
摘要:redhat 下开启FTP(已安装FTP服务器)[root@erpapptest init.d]#/etc/rc.d/init.d/vsftpd statusvsftpd (pid 29792) is running...以下是架设FTP服务器~~参考网址http://hi.baidu.com/wa...
阅读全文
摘要:http://blog.csdn.net/gobitan/article/details/1809763总结: 转发代理服务器代理 client, 反向代理服务器代理server转发代理服务器与反向代理服务器说到代理服务器,大部分人都应该比较熟悉了。记得在学校的时候因为校园网无法访问国外网站,因此经...
阅读全文
摘要:http://blog.csdn.net/woxiaozhi/article/details/27328557文章太好了,转载过啦这篇文章分为上下两篇 确实不错 所以存在这里收藏TCP是一个巨复杂的协议,因为他要解决很多问题,而这些问题又带出了很多子问题和阴暗面。所以学习TCP本身是个比较痛苦的过程...
阅读全文
摘要:标题:浅谈Volatile与多线程2011-04-19 22:49:17最近看的比较杂,摘了一些人的笔记!随着多核的日益普及,越来越多的程序将通过多线程并行化的方式来提升性能。然而,编写正确的多线程程序一直是一件非常困的事情,volatile关键字的使用就是其中一个典型的例子。C/C++中的vola...
阅读全文
摘要:在任何处理器平台下,都会有一些原子性操作,供操作系统使用,我们这里只讲x86下面的。在单处理器情况下,每条指令的执行都是原子性的,但在多处理器情况下,只有那些单独的读操作或写操作才是原子性的。为了弥补这一缺点,x86提供了附加的lock前缀,使带lock前缀的读修改写指令也能原子性执行。带lock前...
阅读全文
摘要:总览 (SYNOPSIS)#include int printf(const char *format, ...);int fprintf(FILE *stream, const char *format, ...);int sprintf(char *str, const char *format...
阅读全文
摘要:为什么用strlcpy取代strncpy标签:C,C语言,strlcpy,strncpy标题: 为什么用strlcpy取代strncpy作者: Demon链接:http://demon.tw/copy-paste/strlcpy-replace-strncpy.html版权: 本博客的所有文章,都遵...
阅读全文
摘要:linux系统调用和库函数调用的区别Linux下对文件操作有两种方式:系统调用(system call)和库函数调用(Library functions)。可以参考《Linux程序设计》(英文原版为《Beginning Linux Programming》,作者是Neil Matthew和Richa...
阅读全文