"Add Q&A sections to array/linked_list and tree chapters" (#682)

* "Add Q&A sections to array/linked_list and tree chapters"

Added question and answers related to the use of std::list in C++ and space complexity in full binary tree traversal to their respective chapters in array_and_linked_list and tree documentation.

* Update summary.md

* Update summary.md

* Update summary.md

---------

Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
Sizhuo Long
2023-08-18 04:49:53 +10:00
committed by GitHub
parent c310edb672
commit 4eb621dda7
2 changed files with 13 additions and 0 deletions

View File

@@ -46,3 +46,7 @@
- `equals()`:用来对比两个对象的值是否相等。
因此如果要对比值,我们通常会用 `equals()` 。然而,通过 `String a = "hi"; String b = "hi";` 初始化的字符串都存储在字符串常量池中,它们指向同一个对象,因此也可以用 `a == b` 来比较两个字符串的内容。
!!! question "广度优先遍历到最底层之前,队列中的节点数量是 $2^h$ 吗?"
是的,例如高度 $h = 2$ 的满二叉树,其节点总数 $n = 7$ ,则底层节点数量 $4 = 2^h = (n + 1) / 2$ 。