自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

点滴在心

学习、记录与分享

  • 博客(170)
  • 资源 (7)
  • 收藏
  • 关注

原创 leetcode 目录--更新....

 //注:很多代码未加入,内存分配是否成功的判断!//二维数组分配问题需注意,leetcode 可以接受变量的a[m][n],自己实现需,int **a = new int [m];for(){a[i] = new int[n]} -- 释放类似1、String to Integer (atoi)2、 Populating Next Right Pointers in Each Nod...

2013-11-24 19:23:44 1927

原创 Sort Colors

Sort ColorsGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we w...

2018-08-24 10:13:03 186

转载 多个正则引擎的比较(pcre re2 hyperscan)

A comparison of regex engines (多个正则引擎的比较) https://rust-leipzig.github.io/regex/2017/03/28/comparison-of-regex-engines/

2017-05-04 18:39:15 6128

原创 解析URL

简介在github有轮子http-parser解析器,小的就不再造轮子了,哈哈(造这个轮子真不是一时半会的事)。目前该解析器用于nodejs的http解析,另还有大家熟知的tcpflow 以及 libtnet都以他作为引擎。 http-parser地址:http-parserhttp-parser是一个用C代码编写的HTTP消息解析器。可以解析HTTP请求或者回应消息。 这个解析器常常在高性能的H

2016-08-18 17:35:45 2759

转载 Netfilter的使用和实现

本文主要内容:Netfilter的原理和实现浅析,以及示例模块。内核版本:2.6.37Author:zhangskd @ csdn blog原文章地址: http://blog.csdn.net/zhangskd/article/details/22678659概述 Netfilter为多种网络协议(IPv4、IPv6、ARP等)各提供了一套

2016-08-02 09:16:33 1783

原创 柔性数组

柔性数组数组大小待定的数组(可变)C语言中结构体的最后一个元素可以是大小可变的数组 (只能放在结构体中,表明一种符号)C语言中可以由结构体产生柔性数组int size[0]这种在C/C++是不允许的,但是在结构中确实可以使用的(C99标准)。经过查看资料,知道这种可变数组被称为柔性数组。在通信行业这种代码司空见惯。柔性数组的结构如何只能堆上生成,C99的扩展,简而言之就是一个在struct结

2016-08-01 11:56:11 397

转载 webbench 源码剖析

webbench 代码不超过500行,比较小巧!

2014-10-25 16:09:05 2444

转载 二叉树中两个节点的最近公共父节点

二叉树中两个节点的最近公共父节点,

2014-09-02 20:51:17 3251

转载 类似无穷期望概率题

首先介绍:两个人抛硬币来决定谁吃这个苹果,先抛到正面者吃。问先抛者吃到苹果的概率是多少?此种,先假设某种情况,需要P,zaig

2014-09-01 11:05:24 2260

转载 C++中 overload 、override、overwrite 之间的区别

转自:http://blog.csdn.net/jszhangyili/article/details/7570311gerOverload、Overwrite和Override的概念比较容易混淆,而且Overwrite和Override的中文翻译五花八门,让人很Confuse,顾保持英文原意:Overload  重载在C++程序中,可以将语义、功能相似的几个函数用

2014-08-19 22:09:08 729

转载 Linux环境进程间通信(二): 信号

原文来自: http://www.ibm.com/developerworks/cn/linux/l-ipc/part2/index1.html#icomments

2014-08-14 22:24:31 597

原创 cron调度问题

cron是一个后台调度程序。该进程一分钟检查一次,并读取crontab文件进行执行。使用crontab -e生成的文件在/var/spool/cron/crontabs  下根据相应的用户名命名。在用的时候碰到一问题,按正常的步骤 crontab -e 编辑* * * * * /bin/echo "hello" 写入后发现并没有反应,后来查到需要安装邮件系统类东西。但是我想找具体原

2014-08-08 20:42:29 737

原创 awk 中单引号的问题

对于shell 对双引号会对$,\,' 进行

2014-08-07 11:05:11 6058 1

原创 两个人抛硬币来决定谁吃这个苹果,先抛到正面者吃。问先抛者吃到苹果的概率是多少?

A和B2人投硬币,正面A得1元,反面B得一元.起始时A有1元,B有100元. 游戏持续进行,直到其中1人破产才终止.1.如果硬币正反概率相同,游戏的期待长度(expected duration)是几次投掷?  2.如果硬币是不公正的,正面概率为P,反面概率为Q.(P+Q=1), 那么游戏的期待长度(expectedduration)是几次投掷?目前认为只有奇数次才可能破产。

2014-07-31 22:39:51 21589 2

原创 Remove Element

Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.一

2014-07-24 10:55:46 516

原创 Sort Colors

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the integers

2014-07-10 17:16:32 526

原创 Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is

2014-07-10 10:46:12 498

原创 Simplify Path

Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"click to show corner cases.Corner Cases:Did

2014-07-09 22:59:14 479

原创 Anagrams

Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.此题已处理的了,回文。首先

2014-07-09 17:34:37 511

原创 Count and Say

The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as 

2014-07-09 16:36:37 551

原创 数字转中文表示

此处表达式b#include #include #include using namespace std;string int_to_num(int num);int main(){ int num; cin>>num; cout<<int_to_num(num)<<endl; return 0;}string int_to_num(int num)

2014-07-09 11:36:40 638

原创 Longest Palindromic Substring

#include #include #include using namespace std;string longestPalindrome(string s) ;int main(){ string s; cin>>s; cout<<longestPalindrome(s)<<endl; return 0;}string longestPalindrome

2014-07-08 11:15:57 917

原创 4Sum

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note:Element

2014-07-07 21:54:03 484

原创 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact

2014-07-07 10:59:42 542

原创 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,c

2014-07-07 10:11:10 510

原创 Distinct Subsequences

Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be non

2014-07-04 16:38:41 507

原创 Decode Ways

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine the total nu

2014-07-04 15:07:32 450

原创 Edit Distance

Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:

2014-07-03 20:39:17 548

原创 Largest Rectangle in Histogram -- 待看

Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width o

2014-07-03 15:25:35 479

原创 Triangle

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [

2014-07-02 15:50:23 911

原创 Search a 2D Matrix

Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each

2014-07-02 11:19:01 505

原创 Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2014-07-02 10:53:20 468

原创 Search for a Range

Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found

2014-07-02 10:32:21 456

原创 Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin

2014-07-01 16:36:08 473

原创 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo

2014-07-01 15:46:20 445

原创 Best Time to Buy and Sell Stock III

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most two transactions.此题看清题,最多俩次jiaoy

2014-06-30 21:27:19 480

原创 Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on

2014-06-30 21:13:56 448

原创 Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),

2014-06-30 21:06:50 507

原创 Jump Game II

//dp 问题 ,dp[i] = min(dp[j])+1;(0 i的情况(即能覆盖i) ) //dp[i] 为0-i的的最少步数 int jump_game(int *a,int n) { if (a == NULL || n <= 0) { return 0; } int *count = new int [n];

2014-06-30 17:16:39 466

原创 Jump Game

Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine i

2014-06-30 17:05:14 481

Visual+C+++课程设计桉例精编 附书代码

Visual+C+++课程设计桉例精编(附书代码)

2013-08-05

Qt实现的玻璃界面效果

Qt实现的玻璃界面效果(反光、半透明。投影

2013-08-05

VC编程小技巧20个

VC编程小技巧20个---最好放到word中看看吧

2010-10-03

VC++基础数据库操作完成学生成绩管理软件

VC++ 基础数据库 操作完成学生成绩管理软件--好东西值得学习

2010-10-03

vc++写的 数字电子钟

vc++写的 数字电子钟 绝对好东西 改造成成自己的时钟

2010-10-03

国人的图书管理系统源码

vc++ 国人的图书管理系统源码---好东东 啊

2010-09-29

排课vc++毕业设计

排课vc++毕业设计,不下不要后悔哦,也是我找了好久的

2010-09-29

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除