Skip to content

Commit 582d66f

Browse files
author
luzhipeng
committed
chore: 基础数据结构部分增加少量描述文字
1 parent 73ae999 commit 582d66f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

thinkings/basic-data-structure-en.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ The non-linear structure contains tree, graph and so on.
1616
1717
It should be noted that, the linear and non-linear date structures do NOT mean that the data in those structure are stored in a linear or non-linear on the hard disk. It is just a logic partition. For example, binary tree can be stored in array.
1818

19+
Generally speaking, the data structure which has `pre` and `next` is linear.
20+
Such as Array and Linked List, actually the Linked List is a kind of `Single Tree`
1921
### Array
2022

2123
Array is the simplest data structure and is used in so many places. For example, array is perfectly appropriate to store a data list. And in fact, you can find array behind many other data structures.
@@ -306,6 +308,9 @@ BTW, you can find more details and algorithms in the charpter [binary tree trave
306308

307309
Heap is a kind of priority queue which is built in many data structure. But unfortunately, JS does not have a native implementation of this data structure. However, it won't be a problem for understanding and using this structure.
308310

311+
Note that: heap is not the only implementation of `priority queue`, there're a lot of more complex
312+
implementations
313+
309314
Related algorithm:
310315

311316
- [295.find-median-from-data-stream](../problems/295.find-median-from-data-stream.md)

thinkings/basic-data-structure.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
1515
需要注意的是,线性和非线性不代表存储结构是线性的还是非线性的,这两者没有任何关系,它只是一种逻辑上的划分。
1616
比如我们可以用数组去存储二叉树。
17+
18+
一般而言,有前驱和后继的就是线性数据结构。比如数组和链表。其实一叉树就是链表。
1719
### 数组
1820

1921
数组是最简单的数据结构了,很多地方都用到它。 比如有一个数据列表等,用它是再合适不过了。
@@ -305,6 +307,8 @@ return, children, sibling也都是一个fiber,因此fiber看起来就是一个
305307
堆其实是一种优先级队列,在很多语言都有对应的内置数据结构,很遗憾javascript没有这种原生的数据结构。
306308
不过这对我们理解和运用不会有影响。
307309

310+
需要注意的是优先队列不仅有堆一种,还有更复杂的,但是通常来说,我们会把两者做等价。
311+
308312
相关算法:
309313

310314
- [295.find-median-from-data-stream](../problems/295.find-median-from-data-stream.md)

0 commit comments

Comments
 (0)