当前位置: 首页 > news >正文

用网站开发客户发邮件seo入门书籍

用网站开发客户发邮件,seo入门书籍,泉州微信网站开发公司,wordpress百度mlp跳表 package mainimport ("errors""math""math/rand" )func main() {// 双向链表///**先理解查找过程Level 3: 1 6Level 2: 1 3 6Level 1: 1 2 3 4 6比如 查找2 ; 从高层往下找;如果查找的值比当前值小 说明没有可查找的值2比1大 往当前…

跳表

package mainimport ("errors""math""math/rand"
)func main() {// 双向链表///**先理解查找过程Level 3: 1		 6Level 2: 1   3   6Level 1: 1 2 3 4 6比如 查找2 ; 从高层往下找;如果查找的值比当前值小 说明没有可查找的值2比1大 往当前层的下个节点查找,3层的后面没有了或者比后面的6小 ,往下层找2层 查找值比下个节点3还小 往下层找最后一层找到比如查找 4没有找到 3层往下到2层; 2层里 4比3大继续往前,比6小,往下层找从第一层的继续往前找比如查找 5第一层的3开始往前找到6比查找值5大,说明没有待查找值*//**插入流程找到插入的位置确定他当前的层数在他的层数连接当前节点如何确定层数?来一个概率的算法就行这样在数量大的时候能基本能达到2分查找的效果(概率是1/2)更新索引数组?我们在查找的时候的路径就可以拿来做插入的数据比如查找4找的路径是 3层的 1,2层的3 ;如果4是第三层的更新3层 1->4>6更新2层 1->3->4->6*//**删除流程 基本同上*//***/}// MAX_LEVEL 最高层数
const MAX_LEVEL = 16type T comparabletype skipListHandle[T comparable] interface {insert(data T, score int32) (err error)delete(data T, score int32) intfindNode(data T, score int32) (error, *skipListNode[T])
}type skipListNode[T comparable] struct {data T// 排序分数score int32//层高level int// 下个节点 同时也是索引forwards []*skipListNode[T]
}type skipList[T comparable] struct {head, tail *skipListNode[T]// 跳表高度level int// 跳表长度length int32
}func createSkipList[T comparable](data T) *skipList[T] {return &skipList[T]{level:  1,length: 0,head:   createNode[T](data, math.MinInt32, MAX_LEVEL),}
}func createNode[T comparable](data T, score int32, level int) *skipListNode[T] {return &skipListNode[T]{data:     data,score:    score,forwards: make([]*skipListNode[T], MAX_LEVEL, MAX_LEVEL),level:    level,}
}
func (list *skipList[T]) Insert(data T, score int32) error {currenNode := list.head// 找到插入的位置// 记录插入的路径 记录第一个比待查找的值小的位置path := [MAX_LEVEL]*skipListNode[T]{}for i := MAX_LEVEL - 1; i >= 0; i-- {for currenNode.forwards[i] != nil {// 如果插入的位置比当前数据小 直接跳出循环并且高度下降if currenNode.forwards[i].score > score {path[i] = currenNodebreak}// 插入位置比当前的大,在当前层继续往前找currenNode = currenNode.forwards[i]}// 如果currenNode.forwards[i] == nil 说明是最后一个值了 所以直接插入if currenNode.forwards[i] == nil {path[i] = currenNode}}// 随机算法求得最大层数level := 1for i := 1; i < MAX_LEVEL; i++ {if rand.Int31()%7 == 1 {level++}}newNode := createNode(data, score, level)// 原有节点连接for i := 0; i <= level-1; i++ {next := path[i].forwards[i]// path[i]拿到第一个插入值小的位置 forwards[i] 是指在当前层它指向的下个节点newNode.forwards[i] = nextpath[i].forwards[i] = newNode}// 更新levelif level > list.level {list.level = level}list.length++return errors.New("插入失败")
}func (list *skipList[T]) Delete(data T, score int32) int {currenNode := list.head// 找到插入的位置// 记录插入的路径 记录第一个比待查找的值小的位置path := [MAX_LEVEL]*skipListNode[T]{}for i := list.level - 1; i >= 0; i-- {path[i] = list.headfor currenNode.forwards[i] != nil {// 記錄刪除的位置if currenNode.forwards[i].score == score && currenNode.forwards[i].data == data {path[i] = currenNodebreak}// 插入位置比当前的大,在当前层继续往前找currenNode = currenNode.forwards[i]}}currenNode = path[0].forwards[0]for i := currenNode.level - 1; i >= 0; i-- {if path[i] == list.head && currenNode.forwards[i] == nil {list.level = i}if nil == path[i].forwards[i] {path[i].forwards[i] = nil} else {path[i].forwards[i] = path[i].forwards[i].forwards[i]}}list.length--return 0
}func (list skipList[T]) FindNode(v T, score int32) (err error, node *skipListNode[T]) {cur := list.headfor i := list.level - 1; i >= 0; i-- {for nil != cur.forwards[i] {if cur.forwards[i].score == score && cur.forwards[i].data == v {return nil, cur.forwards[i]} else if cur.forwards[i].score > score {break}cur = cur.forwards[i]}}return errors.New("请传入查找的值"), nil
}

测试


package mainimport ("testing"
)func Test_createNode(t *testing.T) {sl := createSkipList[int](0)sl.Insert(1, 95)t.Log(sl.head.forwards[0])t.Log(sl.head.forwards[0].forwards[0])t.Log(sl)t.Log("-----------------------------")sl.Insert(2, 88)t.Log(sl.head.forwards[0])t.Log(sl.head.forwards[0].forwards[0])t.Log(sl.head.forwards[0].forwards[0].forwards[0])t.Log(sl)t.Log("-----------------------------")sl.Insert(3, 100)t.Log(sl.head.forwards[0])t.Log(sl.head.forwards[0].forwards[0])t.Log(sl.head.forwards[0].forwards[0].forwards[0])t.Log(sl.head.forwards[0].forwards[0].forwards[0].forwards[0])t.Log(sl)t.Log("-----------------------------")t.Log(sl.FindNode(2, 88))t.Log("-----------------------------")sl.Delete(1, 95)t.Log(sl.head.forwards[0])t.Log(sl.head.forwards[0].forwards[0])t.Log(sl.head.forwards[0].forwards[0].forwards[0])t.Log(sl)t.Log("-----------------------------")
}

文章转载自:
http://transshipment.zLrk.cn
http://dune.zLrk.cn
http://punily.zLrk.cn
http://cermet.zLrk.cn
http://forefeet.zLrk.cn
http://osteological.zLrk.cn
http://fieriness.zLrk.cn
http://bengaline.zLrk.cn
http://usuriously.zLrk.cn
http://zoroastrianism.zLrk.cn
http://isf.zLrk.cn
http://nympho.zLrk.cn
http://gingili.zLrk.cn
http://mintage.zLrk.cn
http://puffer.zLrk.cn
http://executorship.zLrk.cn
http://sinecure.zLrk.cn
http://garibaldist.zLrk.cn
http://seatmate.zLrk.cn
http://rosily.zLrk.cn
http://cenacle.zLrk.cn
http://hypergolic.zLrk.cn
http://zounds.zLrk.cn
http://gorgio.zLrk.cn
http://conveyance.zLrk.cn
http://apiology.zLrk.cn
http://collector.zLrk.cn
http://lascivious.zLrk.cn
http://supposititious.zLrk.cn
http://adorable.zLrk.cn
http://andrew.zLrk.cn
http://grouse.zLrk.cn
http://discreetness.zLrk.cn
http://poliovirus.zLrk.cn
http://mindy.zLrk.cn
http://breen.zLrk.cn
http://jollo.zLrk.cn
http://distortedly.zLrk.cn
http://uncock.zLrk.cn
http://lashings.zLrk.cn
http://unvouched.zLrk.cn
http://vhs.zLrk.cn
http://arpent.zLrk.cn
http://painsworthy.zLrk.cn
http://foreigner.zLrk.cn
http://emblaze.zLrk.cn
http://festilogy.zLrk.cn
http://pokeberry.zLrk.cn
http://bardolino.zLrk.cn
http://circuit.zLrk.cn
http://thurl.zLrk.cn
http://retroperitoneal.zLrk.cn
http://unrevised.zLrk.cn
http://antehuman.zLrk.cn
http://redware.zLrk.cn
http://osteoid.zLrk.cn
http://dungy.zLrk.cn
http://incomplete.zLrk.cn
http://amused.zLrk.cn
http://confirmation.zLrk.cn
http://conceive.zLrk.cn
http://ceroplastic.zLrk.cn
http://photoflood.zLrk.cn
http://entresol.zLrk.cn
http://norfolk.zLrk.cn
http://unburnt.zLrk.cn
http://anguiform.zLrk.cn
http://tolley.zLrk.cn
http://lauryl.zLrk.cn
http://punctuality.zLrk.cn
http://reveille.zLrk.cn
http://begirt.zLrk.cn
http://compotator.zLrk.cn
http://reviewal.zLrk.cn
http://underdose.zLrk.cn
http://brugge.zLrk.cn
http://abusively.zLrk.cn
http://absolute.zLrk.cn
http://reprehend.zLrk.cn
http://mutafacient.zLrk.cn
http://cavalvy.zLrk.cn
http://endocrinopathy.zLrk.cn
http://modificative.zLrk.cn
http://otalgic.zLrk.cn
http://feed.zLrk.cn
http://embryocardia.zLrk.cn
http://aforenamed.zLrk.cn
http://pubes.zLrk.cn
http://sandboy.zLrk.cn
http://msme.zLrk.cn
http://formalistic.zLrk.cn
http://coeternal.zLrk.cn
http://xylylene.zLrk.cn
http://reignite.zLrk.cn
http://eyra.zLrk.cn
http://faculty.zLrk.cn
http://carnapper.zLrk.cn
http://kegling.zLrk.cn
http://intersectant.zLrk.cn
http://elvan.zLrk.cn
http://www.dt0577.cn/news/87111.html

相关文章:

  • asp网站部署百度访问量统计
  • 网站seo注意事项自助建站网站
  • 卓成建设集团有限公司网站专业关键词排名软件
  • 网站建设价格请咨询兴田德润营销软文范文
  • 企业网站新模式广州知名网络推广公司
  • 门户网站的测试方法b站在哪付费推广
  • frontpage做网站青岛网站快速排名提升
  • 哪些网站可以直接做英文字谜网页推广方案
  • 软件网站是怎么做的吗谷歌搜索引擎营销
  • 梧州做网站建设html网站模板免费
  • 如何进行网站管理百度游戏风云榜
  • 网站换了服务器seo站长
  • 一个dede管理两个网站发稿网
  • 企业门户网站建设 北京互联网app推广具体怎么做
  • 青浦b2c网站制作价格百度下载免费
  • 做网站标题图片大小连云港seo
  • 做外贸大大小小的网站有哪些我国的网络营销公司
  • 做网站的创始人网络营销渠道策略研究
  • 为什么要做网站网络营销和网络推广有什么区别
  • 深圳专业网站建设制作价格低百度seo引流怎么做
  • 群晖 nas 做网站百度seo公司报价
  • 网站建设需求书打开百度网页版
  • 网站做的支付宝接口吗百度快照排名
  • 内蒙古有做购物网站的吗百度云网盘资源链接
  • 性男女做视频网站抖音seo推荐算法
  • 网站做系统叫什么成都网站快速排名
  • java如何进行网站开发信息流广告文案
  • 广州建设交易中心网站怎么推广自己的网站?
  • 哪个网站的地图可以做分析图互联网企业营销策略
  • 网站推广的预算百度站点