<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[chencong125的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/chencong125</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; chencong125]]></copyright><item><title><![CDATA[STL   hash_map]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/48193843</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/48193843</guid><author>chencong125</author><pubDate>Thu, 03 Sep 2015 10:54:17 +0800</pubDate><description><![CDATA[定义哈希函数和比较函数include include include using namespace std;  
 //define the class  
struct ClassA 
 {  
    ClassA(int a):c_a(a){}  
    int getvalue()const { return c_a;}  
    size_t c_a; 
 }; 
 //1 defi]]></description><category></category></item><item><title><![CDATA[KMP模式匹配算法]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47778873</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47778873</guid><author>chencong125</author><pubDate>Wed, 19 Aug 2015 12:41:03 +0800</pubDate><description><![CDATA[先看看next数据值的求解方法 
  位序       1   2   3   4   5   6   7   8   9 
模式串     a   b   a   a   b   c   a   b   c 
 next值     0   1   1   2   2   3   1   2   3 
next数组的求解方法是： 
1.第一位的next值为0 
2.第二位的next值为1 
后面求解]]></description><category></category></item><item><title><![CDATA[回调函数]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47757711</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47757711</guid><author>chencong125</author><pubDate>Tue, 18 Aug 2015 19:55:08 +0800</pubDate><description><![CDATA[什么是回调函数? 
简而言之，回调函数就是被调用者回头调用调用者的函数。    使用回调函数实际上就是在调用某个函数（通常是API函数）时，将自己的一个函数（这个函数为回调函数）的地址作为参数传递给那个被调用函数。而该被调用函数在需要的时候，利用传递的地址调用回调函数。    回调函数，就是由你自己写的，你需要调用另外一个函数，而这个函数的其中一个参数，就是你的这个回调函数名。这样，系统在必要的时候]]></description><category></category></item><item><title><![CDATA[Linux面试]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47377175</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47377175</guid><author>chencong125</author><pubDate>Sun, 09 Aug 2015 16:27:19 +0800</pubDate><description><![CDATA[1．简述Linux文件系统通过i节点把文件的逻辑结构和物理结构转换的工作过程。 
答：Linux通过i节点表将文件的逻辑结构和物理结构进行转换。 
i 节点是一个64字节长的表，表中包含了文件的相关信息，其中有文件的大小、文件所有者、文件的存取许可方式以及文件的类型等重要信息。在i节点表中最重要 的内容是磁盘地址表。在磁盘地址表中有13个块号，文件将以块号在磁盘地址表中出现的顺序依次读取相应的块。L]]></description><category></category></item><item><title><![CDATA[TCP传输层协议]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47342413</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47342413</guid><author>chencong125</author><pubDate>Fri, 07 Aug 2015 17:20:22 +0800</pubDate><description><![CDATA[TCP协议特点：面向连接、字节流、可靠传输 
面向连接： 
使用TCP协议的双方必须首先建立连接，并且双方都必须分配相应的内核资源。TCP的连接是全双工的，也就是说双方可以根据一个连接进行读写操作。 
字节流： 
1、当发送方多次写操作的时候，TCP发送模块会先把数据放在发送缓冲区中，当TCP发送模块真正发送的时候，这些在发送缓冲区中的数据才可能被封装成一个或多个报文段发出。所以，应用程序执行的写操]]></description><category></category></item><item><title><![CDATA[STL之priority_queue]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47336739</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47336739</guid><author>chencong125</author><pubDate>Fri, 07 Aug 2015 11:34:30 +0800</pubDate><description><![CDATA[#include <iostream>  
#include<functional>
#include <queue>  using namespace std;  struct Node{  
    int x;  
    Node( int a= 0):x(a) {}  
    friend bool operator<(Node a,Node b )
    {  
       ret]]></description><category></category></item><item><title><![CDATA[STL中 map的用法]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47319753</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47319753</guid><author>chencong125</author><pubDate>Thu, 06 Aug 2015 17:02:15 +0800</pubDate><description><![CDATA[STL的排序问题，STL中默认是采用小于号来排序的，关键字是int型，它本身支持小于号运算，可以进行map的插入操作，但是一些其他的情况下，比如关键字是一个结构体，涉及到排序就会出现问题，因为它没有小于号操作，insert等函数在编译的时候过不去，下面给出两个方法解决这个问题  
第一种：小于号重载，程序举例 #include<map>
#include<iostream>
#include<str]]></description><category></category></item><item><title><![CDATA[对给定字符串，取出它的子字符串，并把子字符串按照长度排序]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47285191</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47285191</guid><author>chencong125</author><pubDate>Tue, 04 Aug 2015 23:28:25 +0800</pubDate><description><![CDATA[#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;bool myfunction (const string str1,const string str2) {     return (str2.length() < str1.length());
}void my]]></description><category></category></item><item><title><![CDATA[去除字符串中的重复子字符串]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47285141</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47285141</guid><author>chencong125</author><pubDate>Tue, 04 Aug 2015 23:26:02 +0800</pubDate><description><![CDATA[#include<iostream>
#include<string>
using namespace std;
int delete_sub_str(char *input,char *sub_str,char *result)
{
    int count=0;
    int len = strlen(sub_str);
    char *p = result;
    while(*in]]></description><category></category></item><item><title><![CDATA[取出整型数据中存在指定整数的数据，并按照升序排列返回]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47285117</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47285117</guid><author>chencong125</author><pubDate>Tue, 04 Aug 2015 23:24:26 +0800</pubDate><description><![CDATA[取出整型数据中存在指定整数的数据，并按照升序排列返回。 
要求实现方法：  
public static int[] calcTimes(int[] num, int value); 
【输入】 num：整型数组； 
           value 指定的整数 
【返回】 按照升序排列返回整型数组中包含指定整数的元素 
示例  
输入：num = {12345,654123,98764,12365]]></description><category></category></item><item><title><![CDATA[socket、Tcp/IP通信]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47093077</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47093077</guid><author>chencong125</author><pubDate>Mon, 27 Jul 2015 22:44:13 +0800</pubDate><description><![CDATA[1.使用udp和tcp进程网络传输，为什么tcp能保证包是发送顺序，而 udp无法保证？ 
    主机每次发送数据时，TCP就给每个数据包分配一个序列号并且在一个特定的时间内等待接收主机对分配的这个序列号进行确认，如果发送主机在一个特定时间内没有收到接收主机的确认，则发送主机会重传此数据包。接收主机利用序列号对接收的数据进行确认，以便检测对方发送的数据是否有丢失或者乱序等，接收主机一旦收到已经顺序]]></description><category></category></item><item><title><![CDATA[[leetcode]Word Ladder]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47056543</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47056543</guid><author>chencong125</author><pubDate>Sat, 25 Jul 2015 15:03:23 +0800</pubDate><description><![CDATA[#include<iostream>
#include<string>
#include<set>
#include<unordered_set>
#include<unordered_map>
#include<map>
#include<deque>
using namespace std;
class Solution
{
public:
    int wordladder(string s]]></description><category></category></item><item><title><![CDATA[[leetcode]Search for a Range]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47047701</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47047701</guid><author>chencong125</author><pubDate>Fri, 24 Jul 2015 21:56:12 +0800</pubDate><description><![CDATA[#include<iostream>
#include<vector>
using namespace std;
class Solution1
{
public:
    vector<int> findindex(vector<int>a,int target)
    {
        vector<int>res;
        int first=0,last=a.size()-1;]]></description><category></category></item><item><title><![CDATA[[leetcode]Search Insert Position]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47044345</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47044345</guid><author>chencong125</author><pubDate>Fri, 24 Jul 2015 17:24:23 +0800</pubDate><description><![CDATA[#include<iostream>
#include<vector>
using namespace std;
class Solution
{
public:
    int findindex(vector<int>a,int target)
    {
        if(a.empty())
            return 0;
        int first=0,last=a]]></description><category></category></item><item><title><![CDATA[[leetcode]Search a 2D Matrix]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/47044001</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/47044001</guid><author>chencong125</author><pubDate>Fri, 24 Jul 2015 17:07:14 +0800</pubDate><description><![CDATA[#include<iostream>
#include<vector>
using namespace std;
class Solution
{
public:
    bool find(vector<vector<int>>a,int target)
    {
        int l=0;
        int r=a.size()*a.back().size()-1;]]></description><category></category></item><item><title><![CDATA[[leetcode]First Missing Positive]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/46971089</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/46971089</guid><author>chencong125</author><pubDate>Mon, 20 Jul 2015 17:13:51 +0800</pubDate><description><![CDATA[#include<iostream>
using namespace std;void findfirstpositive(int a[],int length)
{
    for(int i=0;i<length;i++)
    {
        if(a[i]>0&&a[i]<=length&&i!=a[i]-1)
        {
            swap(a[i],a[a[i]]></description><category></category></item><item><title><![CDATA[[leetcode] Insertion Sort List]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/46969259</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/46969259</guid><author>chencong125</author><pubDate>Mon, 20 Jul 2015 15:47:37 +0800</pubDate><description><![CDATA[#include<iostream>
using namespace std;struct ListNode
{
    int value;
    ListNode* next;
    ListNode(int value):value(value),next(NULL){};
};
ListNode* Insertsort(ListNode* head)
{
    if(!head)]]></description><category></category></item><item><title><![CDATA[排序]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/46941405</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/46941405</guid><author>chencong125</author><pubDate>Sat, 18 Jul 2015 11:48:01 +0800</pubDate><description><![CDATA[#include<iostream>
using namespace std;
void Insertsort(int a[],int length)
{
    /*int i,j,temp;
    for(i=0;i<length-1;i++)
    {
        j=i+1;
        if(a[j]<a[i])
        {
            temp=a[j];]]></description><category></category></item><item><title><![CDATA[[leetcode]  Convert Sorted List to Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/46929295</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/46929295</guid><author>chencong125</author><pubDate>Fri, 17 Jul 2015 16:32:49 +0800</pubDate><description><![CDATA[#include<iostream>
#include<vector>
using namespace std;
struct TreeNode
{
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int val):val(val),left(NULL),right(NULL){};
};
struct ListN]]></description><category></category></item><item><title><![CDATA[[leetcode]Convert Sorted Array to Binary Search Tree]]></title><link>https://blog.youkuaiyun.com/chencong125/article/details/46927405</link><guid>https://blog.youkuaiyun.com/chencong125/article/details/46927405</guid><author>chencong125</author><pubDate>Fri, 17 Jul 2015 14:51:07 +0800</pubDate><description><![CDATA[#include<iostream>
#include<vector>
using namespace std;
struct TreeNode
{
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int val):val(val),left(NULL),right(NULL){};
};
class Soluti]]></description><category></category></item></channel></rss>