# 计数Trie中的节点 -- data-structures 领域 和 trees 领域 和 probability-theory 领域 和 average-case 领域 cs 相关 的问题

## Counting nodes in a trie

3

### 问题

If you don't have any degree-1 nodes in your trie (which is a tree) than you have more leaves than interior nodes. So in this case you have $I\le n$.

It depends a bit how you define the trie whether you can have many interior degree-1 nodes. If you study a compressed trie the all the path of degree-1 nodes are merges to an edge, so you are done. For an uncompressed trie, I am afraid, you can have many degree-1 nodes. Say you have one letter $a_i$ that is very common and has a high probability of $1-\varepsilon$ and $\varepsilon\in \Omega(1/n^2)$. Then your trie contains many long degree-1 paths with high probability. In this case the you can have more than $O(n)$ interior nodes. Please do the computations by yourself (you might choose a smaller $\varepsilon$ if you like).

## 相关问题

0  将项目附加到数组的平均运行时间是多少？  ( What is the average runtime of appending items to arrays )

0  搜索数组的平均时间复杂性[关闭]  ( Average time complexity of searching an array )

3  为什么线性搜索平均是$frac {n} {2}$比较？  ( Why does linear search have fracn2 comparisons on average )

2  如何完成工作的平均案例运行时间（和其他算法）？  ( How to go about working the average case run time of this trivial algorithm and )

5  证明二进制搜索的平均案例复杂性是O（log n）  ( Proving that the average case complexity of binary search is olog n )

2  平均案例分析帮助  ( Average case analysis help )

0  Quicksort的平均案例运行时间分析很好参考  ( Good reference for average case runtime analysis of quicksort )

15  Knuth，De Bruijn和Rice（1972）的“种植平面树的平均高度”  ( On the average height of planted plane trees by knuth de bruijn and rice 197 )

1  一种简单的最大发现算法的平均分析  ( Average case analysis of a simple max finding algorithm )

6  这种可恶劣算法的时间复杂程度是多少？  ( What is the time complexity of this atrocious algorithm )

3  在通用布尔公式中找到真实或错误分配的硬度？  ( Hardness of finding a true or a false assignment into a generic boolean formula )

0  找到最大算法的平均时间复杂度  ( Finding the average time complexity for a max algorithm )

4  用于执行插入的单个链接列表的平均时间复杂性是多少？  ( What is the average time complexity for a single linked list for performing an )

2  问题发现PESIN MAX算法的平均案例  ( Trouble finding average case of a find max algorithm )

2  循环的时间复杂性  ( Time complexity of this while loop )

14  泡沫排序中的掉次数  ( Expected number of swaps in bubble sort )

1  您如何表达关于不成功搜索的定理声明平均 - 与量子散列中的不成功搜索？  ( How do you express the theorem statement about unsuccessful search on average ca )

11  评估给定的Bubblesort算法的平均时间复杂度。  ( Evaluating the average time complexity of a given bubblesort algorithm )

1  鉴于算法，其运行时案例的概率是什么？  ( Given an algorithm what are the probabilities for its run time cases )

3  预期成本和算法平均成本之间有什么区别？  ( What is the difference between expected cost and average cost of an algorithm )

7  在流中保持k $最小的整数的复杂性 ( Complexity of keeping track of k smallest integers in a stream ) 我需要分析在线算法的时间复杂性，以跟踪从$ $numb的流中追踪最低$ k $号码。该算法是 假设流中的$ i $th号码是$ s_i $。 保持尺寸的最大堆$ k $。 如果堆包含少于$ k $元素，请为堆添加$ s_i $。 否则：如果$ s_i $小于堆中的最大元素（即堆的根），请用$ s_i $替换堆的... 6 二进制搜索树和AVL树的平均深度 ( Average depth of a binary search tree and avl tree ) 我的教授最近提到二进制搜索树中的节点的平均深度将是$ o（log（n））$why$ n $是树中的节点量。我最终绘制了一堆二进制搜索树，我不认为我是正确了解这个概念。例如，如果$ n = 4 \$ the tree，则将具有最大3美元或节点的最大深度的节点，最大深度为2美元。在最大值为3美元的情况下，我们将有0美元...