简单回顾一下Etcd中的Wal 先看一下etcd raft library中的rafte示例结构(): image 从图中可以看出,Etcd的raft示例的大致流程: 首先需要启动节点RaftNode 应用层,通...
前言 本文章是建立在插入排序的基础上写的喔,如果有对插入排序还有不懂的童鞋,可以看看这里。 直接/折半插入排序 2路插入排序 希尔排序解释 希尔排序 Shell Sort 又名"缩小增量排序",是对直接插入排序更加高效的改进版...
其实二分查找算法就和我们在一个英文字典中找一个单词一样,比如要找middle这个单词,先把字典翻到大概中间的位置,那么现在字典就被分成两个部分了,middle这个单词要么在第一个部分,要么在第二个部分,如果正好翻到p那一页,那么说明midd...
编程的关键在于选择数据结构和算法,数据结构用于描述问题,算法用于描述解决问题的方法和步骤。 描述问题的数据除了各数据元素本身,还要考虑各元素的逻辑关系,主要是一对一的线性关系,一对多的树型关系和多对多的图形关系。另外,内存中对各数据元素的存...