自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

上善若水

天道酬勤

  • 博客(30)
  • 收藏
  • 关注

原创 LeetCode199—Binary Tree Right Side View

原题原题链接 Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For example: Given the following binary t

2017-01-25 19:32:46 377

原创 LeetCode198—House Robber

原题原题链接 You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacen

2017-01-25 18:31:32 333

原创 LeetCode191—Number of 1 Bits

原题原题链接 Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11’ has binary representation 00000

2017-01-25 18:28:22 343

原创 redis源码学习之整数集合

整数集合intset的底层实现比较简单,因为它所有的key都是整型,只是整型分为16bits、32bits和64bits这三种类型,当新插入的元素比当前集合中所有数还要长时,就要进行升级了,这部分源码很简单,主要就是升级部分。数据结构/* * intset 的编码方式 */#define INTSET_ENC_INT16 (sizeof(int16_t))#define INTSET_EN

2017-01-25 16:47:23 470

原创 redis源码学习之跳跃表

redis源码学习之跳跃表

2017-01-23 17:28:15 791

原创 LeetCode190—Reverse Bits

原题https://leetcode.com/problems/reverse-bits/Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 96417

2017-01-18 17:22:48 474

原创 LeetCode189—Rotate Array

原题https://leetcode.com/problems/rotate-array/Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].分析比较难的是如果只能

2017-01-18 16:29:14 362

原创 redis源码学习之字典

数据结构几个重要的数据结构: dict、dictht、dictEntry分别表示字典,hash表,hash桶。 字典结构体,主要包含了hash表数组(有两个hash表,其中一个备用做rehash用)。typedef struct dict { // 类型特定函数 dictType *type;//函数指针 // 私有数据 void *privdata; /

2017-01-17 21:00:06 479

原创 redis源码学习之链表

redis源码学习之链表

2017-01-17 11:11:40 549

原创 redis源码学习之sds简单动态字符串

redis源码学习之SDS简单动态字符串

2017-01-13 15:11:51 651

原创 Boost.Asio学习之总结

boost.asio学习总结

2017-01-13 10:34:33 2440

原创 Boost.Asio学习之简单的HTTP服务器

Boost.asio实现简单的HTTP服务器

2017-01-13 10:29:50 19180 1

原创 C++中std::string::find_last_of用法

find_last_of用法

2017-01-12 20:47:29 49600 2

原创 url中的特殊符号

URL中的特殊符号,及解析

2017-01-12 20:23:24 5738

原创 LeetCode208—Implement Trie (Prefix Tree)

原题看了WIKI才知道怎么回事。原题链接 Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist of lowercase letters a-z.分析实现一个前缀树/字典树 要求实现插入、查找、前缀查找clas

2017-01-11 21:26:13 409

原创 LeetCode207—Course Schedule

原题原题链接 There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expre

2017-01-11 11:23:31 309

原创 Boost.Asio学习之异步echo服务器实现

Boost.asio异步echo服务器实现

2017-01-10 22:04:58 650

原创 Boost.Asio学习之同步echo服务器实现

boost.asio实现同步echo服务器

2017-01-10 21:36:34 727

原创 Boost.Asio学习之实现广播ChatRoom

boost.asio之实现聊天服务器

2017-01-10 20:58:25 2161

原创 Boost.Asio学习之Buffer

boost.asio学习之buffer

2017-01-10 11:07:30 4481

原创 Boost.Asio学习之Allocation

boostasio 学习之allocation

2017-01-09 23:03:16 992

原创 boost获取threadid

boost获取threadid

2017-01-06 22:34:01 3933

原创 Boost.Asio学习之Tutorial

boost.asio 学习

2017-01-06 22:30:42 1047

原创 ubuntu启动daytime服务

ubuntu启动daytime 服务

2017-01-06 09:40:55 2282

原创 Boost.Asio学习之Proactor模式简介

Boost.asio学习之Proactor模式简介

2017-01-05 15:58:59 2403

原创 LeetCode206—Reverse Linked List

原题原题链接 Reverse a singly linked list.分析逆序一个单链表。 链表操作的题目了,这里需要三个指针,需要额外的一个指针保存当前指针的next节点,因为逆转之后,该节点就跟原链表断开了。代码class Solution { public: ListNode* reverseList(ListNode* head) { if(NULL

2017-01-04 21:44:34 413

原创 LeetCode205—Isomorphic Strings

原题原题链接 Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replac

2017-01-04 21:41:03 333

原创 LeetCode204—Count Primes

原题原题链接 Description: Count the number of prime numbers less than a non-negative number, n.分析找到小于n的所有素数的个数。 没什么说的,如果迭代判断一个数是否是素数肯定是超时的复杂度o(n2)o(n^2) 用埃拉托斯特尼筛选法来解。即先假定2~n所有的数都是素数,那么遍历之后,如果i是素数,那

2017-01-04 21:35:31 456

原创 undefined reference to `vtable for boost::detail::thread_data_base'问题

同样是boost.asio中用到boost.thread处理I/O,编译出错: undefined reference to `vtable for boost::detail::thread_data_base’环境ubuntu14.04 g++ 4.8.4解决办法I had the same question, but -lboost_thread-mt is now deprecated

2017-01-03 16:24:08 5442

原创 undefined reference to `boost::system::generic_category()问题

最近学习boost.asio,写了个简单的server.cpp编译出错: undefined reference to `boost::system::generic_category()环境:ubuntu14.04 g++4.8.4解决办法You should link in the libboost_system library. I am not sure about codeblocks,

2017-01-03 16:21:42 11028

空空如也

空空如也

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

TA关注的人

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