mirror of
https://github.com/krahets/hello-algo.git
synced 2026-05-04 23:00:54 +08:00
"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:
@@ -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$ 。
|
||||
|
||||
Reference in New Issue
Block a user