数据结构与算法:线性结构

上一章提到了数据结构的重要性,这章开始我们就逐步深入理解一下数据结构相关的内容。最常用也是最常见的数据结构都是线性结构,线性结构简单来说就是一条序列,中间有若干元素,“线性” 也是和后面要说的树、图相比而言的。

需要注意的是,数据在计算机中有两种物理存储方式,分别是链式存储和顺序存储,顺序存储是利用计算机中连续一块内存进行存储,链式存储利用指针指向不同的地址进行存储;而上面列出的这些数据结构都是逻辑结构,存储方式不同数据结构的实现方法和复杂度也不同,但效果是可以完全相同的。

存储方式和结构之间没有关系,任何一种结构都可以使用顺序或链式存储实现,要看具体的场景和目的。

More

《Elasticsearch 权威指南》之基础入门 Note(基于 7.x)

目录

## 为了搜索

Elasticsearch 建立在 Lucene 上,它不仅仅是一个全文搜索引擎:

  • 一个分布式的实时文档存储,每个字段 可以被索引与搜索
  • 一个分布式实时分析搜索引擎
  • 能胜任上百个服务节点的扩展,并支持 PB 级别的结构化或者非结构化数据

Install Elasticsearch with Docker | Elasticsearch Reference [7.2] | Elastic

  • docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.2.0

  • curl http://127.0.0.1:9200/_cat/health

  • curl 'http://localhost:9200/?pretty'

Running Kibana on Docker | Kibana User Guide [7.2] | Elastic

  • docker run --link YOUR_ELASTICSEARCH_CONTAINER_NAME_OR_ID:elasticsearch -p 5601:5601 {docker-repo}:{version}

  • http://localhost:5601

存储数据到 Elasticsearch 的行为叫做 索引,但在索引一个文档之前,需要确定将文档存储在哪里。

一个 Elasticsearch 集群可以 包含多个 索引 ,相应的每个索引可以包含多个 类型 。 这些不同的类型存储着多个 文档 ,每个文档又有 多个 属性

More

Syntactic Parsing Note (SLP Ch13)

This chapter focuses on the structures assigned by context-free grammars. Context-free grammars don’t specify how the parse tree for a given sentence should be computed. We therefore need to specify algorithms that employ these grammars to efficiently produce correct trees. They are useful in applications such as grammar checking, semantic analysis, question answering and information extraction.

More

信息熵与选择:由三门问题想到的

今天看公众号文章正好看到一篇《三门问题》,虽然看似简单,但细想感觉很有意思,特意把自己的思考记录一下。三门问题出自上世纪 70 年代美国的一个综艺节目,基本描述是这样的:你是游戏的参与者,面前有三扇门,其中一扇门后面是一辆跑车,其他两扇后面什么都没有。在你选择一扇门后先不打开,主持人打开了另一扇门(后面必然是空的),此时你有两个选择,坚持选择刚才选的那扇,或者换另外一扇还没打开的。怎么选择才能让你得到跑车的概率最大?

More

Sequence Processing with Recurrent Networks Note (SLP Ch09)

Problematic of the sliding window in general NN:

  • Like Markov it limits the context from which information can be extracted (limits to window area)
  • Window makes it difficult to learn systematic patterns arising from phenomena like constituency

RNN is a class of networks designed to address these problems by processing sequences explicitly as sequences, allowing us to handle variable length inputs without the use of arbitrary fixed-sized windows.

More