update algo in open source

This commit is contained in:
nonstriater
2015-12-01 12:19:20 +08:00
parent 4274c48e2b
commit fc00cc6d08
4 changed files with 100 additions and 15 deletions
+12
View File
@@ -27,15 +27,27 @@
正则表达式是模式匹配的基础。是一个一般化了的子字符串的查找问题。也是搜索工具grep的核心。
#### 模式匹配
#### grep
### 数据压缩
#### 游程编码
#### 赫夫曼树
## 参考
《Algorithms》
+86 -13
View File
@@ -1,32 +1,105 @@
数据结构往往是一个项目系统的核心,理解项目的数据结构和算法,才能真正理解项目的工作原理。这里罗列出常用开源系统中用到的数据结构和算法。
数据结构往往是一个项目系统的核心,理解项目的数据结构和算法,才能真正理解项目的工作原理。这里聊聊常用`开源系统`中用到的数据结构和算法。
每一条说清楚:
1. 项目简介
2. 用到算法的功能介绍
3. 用到的算法
##MYSQL 背后的数据结构和算法
1. 项目简介
2. 用到的算法介绍
http://blogread.cn/it/article/4088?f=wb2
## [YYCache](https://github.com/ibireme/YYCache.git)
索引使用B+树
### 项目简介
## Redis
YYCache 是iOS系统上一套线程安全的Key-Value缓存实现,使用Objective-C语言实现。YYCache使用双向链表+hash表结构实现。
### 用到的算法介绍
先来看一下它的数据结构:
```
// 这是一个节点的结构
@interface _YYLinkedMapNode : NSObject {
@package
__unsafe_unretained _YYLinkedMapNode *_prev; // retained by dic
__unsafe_unretained _YYLinkedMapNode *_next; // retained by dic
id _key;
id _value;
NSUInteger _cost;
NSTimeInterval _time;
}
```
这里定义了一个双向链表结构,_prev,_next分别指向前缀节点和后缀节点。
```
@interface _YYLinkedMap : NSObject {
@package
CFMutableDictionaryRef _dic; // do not set object directly
NSUInteger _totalCost;
NSUInteger _totalCount;
_YYLinkedMapNode *_head; // MRU, do not change it directly
_YYLinkedMapNode *_tail; // LRU, do not change it directly
BOOL _releaseOnMainThread;
BOOL _releaseAsynchronously;
}
```
_dic 就是存储缓存节点的hash结构。
## MongoDB
## [cocos2d-objc](https://github.com/cocos2d/cocos2d-objc)
### 项目简介
## Nginx
### 用到的算法介绍
##Cocos2D-iPhone
## [AsyncDisplayKit](https://github.com/facebook/AsyncDisplayKit)
### 项目简介
## JavaScript 对象存储结构
### 用到的算法介绍
## [realm-cocoa](https://github.com/realm/realm-cocoa)
## [YapDatabase](https://github.com/yapstudios/YapDatabase)
## [FTCoreText](https://github.com/Ridiculous-Innovations/FTCoreText)
## [Redis](https://github.com/antirez/redis)
## [memcached](https://github.com/memcached/memcached)
## [Nginx](https://github.com/nginx/nginx)
## [Node](https://github.com/nodejs/node)
V8引擎
## [React](https://github.com/facebook/react)
## [react-native](https://github.com/facebook/react-native)
+1 -1
View File
@@ -206,7 +206,7 @@ DP通常基于一个递推公式及一个(或多个)初始状态,当前子问
## 参考
《算法设计与分析基础》 Anany Levitin
《算法设计与分析基础》 Anany Levitin
http://www.chinaunix.net/old_jh/23/437639.html
+1 -1
View File
@@ -13,7 +13,7 @@
双向链表也叫双链表,是链表的一种,它的每个数据结点中都有两个指针,分别指向直接后继和直接前驱。所以,从双向链表中的任意一个结点开始,都可以很方便地访问它的前驱结点和后继结点。一般我们都构造双向循环链表。
双向链表克服了访问某个节点前驱节点(插入,删除操作时),只能从头遍历的问题。
双向链表克服了单链表中访问某个节点前驱节点(插入,删除操作时),只能从头遍历的问题。
```
typedef int Value