Consideration make three pointers , pre,current,next; initial pre as null use tmp to save current’s next node info change current’s next to link pre node(first is null) move pre pointer to next node move current pointer to next node soultion 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 /** * Definition for singly-linked list.……
hamming-distance
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y < 231. Example: Input: x = 1, y = 4 Output: 2 Explanation: 1 (0 0 0 1) 4 (0 1 0 0) ↑ ↑ The above arrows point to positions where the corresponding bits are different.……
ElasticSearch API 基本操作
查看集群健康值 GET _cat/health?v 查看 node 信息 GET _nodes 查看索引信息 GET _cat/indices?v 创建索引 PUT /test?pretty 删除索引 DELETE /test?pretty 新建文档并建立索引 创建一个index为 ecommerce 的索引 PUT /ecommerce/_doc/1 { "product_id":1234, "product_name": "……
elasticsearch 集群容错
Q:有三台服务器,三个 Primary Shard怎么配置能使 ElasticSearch 达到高可用 在此之前应该先清楚 shard 、primary shard 、replica shard、node 的概念 还……
ElasticSearch 基础概念
documnet 文档,类似于 Java 的实体类,但非面向对象的,比实体类更加灵活。 index 索引,用来存放文档,一个索引可存放若干个 document type ElastcSearch 7 以后过时,使用 _doc 代替,预计在未……
技术选型怎么做
技术选型包括哪些 从个人观点出发,技术选型包括框架、工具、语言。 需要考虑的点 公司规模 团队技术水平 时间和成本 生态 风险 公司规模 小公司 对于初创公司或……
条件概率、全概率与贝叶斯公式
条件概率公式 设事件A 发生的概率为 P(A), 事件B 发生的概率为 P(B),则在事件B发生的情况下事件A发生的概率(A given B 的概率)为: $$ P(A|B)=\frac{P(AB)}{P(B)} $$ 全概率公式 如果……
年终总结
很久没有写博客了,上一篇大概是在月初,这次算是对过去进行总结,准备迎接新的一年。 我不是很会写博客,纯粹是附庸风雅。 2018年 今年是从学校走向……
迁移到 ubuntu18 的问题及配置
今天终于下定决心安装了 Ubuntu 系统,将新系统配置成自己熟悉的模式是需要很长的一段时间,更何况是双系统。下面是我遇到的问题,经过搜索与尝试并解决。 执……
总结
有段时间没有写博客了,因为我在思考如何去写好一篇技术性文章,而不是随性所欲、天马星空似的。以前写的很多博客真的是太潦草,这就和 CSDN 那样一篇文章……