《Redis 設計與實現》第二版讀書筆記之跳躍表

2021-08-26 20:23:22 字數 612 閱讀 4169

redis.h/zskiplistnode結構用於表示跳躍表節點

typedef

struct zskiplistnode level;

// 後退指標

struct zskiplistnode *backward;

// 分值

double score;

// 成員物件

robj *obj;

} zskiplistnode;

層(level):每個層帶有兩個屬性:前進指標和跨度。前進指標用於訪問位於表尾方向的其他節點,而跨度則記錄了前進指標所指向節點和當前節點的距離。

後退指標:指向當前節點的前乙個節點。在從表尾想表頭遍歷時使用

分值:節點按各自所儲存的分值從小到大排列

成員物件:

typedef

struct zskiplist zskiplist;

header:指向跳躍表的表頭結點

tail:指向跳躍表的表尾節點

level:記錄目前跳躍表內,層數最大的那個節點的層數

length:記錄跳躍表的長度,也即是跳躍表目前包含節點的數量

array c 實現,第二版

include include include include using namespace std namespace mylib array const array coll alloc coll.alloc size coll.size ia null array const pointer...

Java設計模式 第二版

1.工廠模式解決取得不同的實現類問題 2.動態 模式,解決rpc不暴露實現類問題 3.單例模式,解決記憶體占用的問題,比如對於工具類 常量類載入一次即可 第1章 緒論 第1部分 介面型模式 第2章 介面型模式介紹 第3章 介面卡 adapter 模式 第4章 外觀 facade 模式 第5章 合成 ...

《學習bash》第二版讀書筆記

bash定製使用者環境的所提供的四個最重要的特性 特殊檔案 bashrc,bash profile 最重要的 bash logout,etc profile 前面三個檔案不存在時使用 別名,選項和變數。bash profile在shell登入時呼叫 在gnome桌面環境中,只有在使用相應的使用者登入...