Java Reference
In-Depth Information
6. It locates the next bucket in the bucket array and points to its first element.
7. 31 ¶ 116 + 111 = 3707.
8. 13.
9. In a tree, each node can have any number of children. In a binary tree, a
node has at most two children. In a balanced binary tree, all nodes have
approximately as many descendants to the left as to the right.
10. For example, Sarah . Any string between Romeo and Tom will do.
11. For both trees, the inorder traversal is 3 + 4 * 5 .
12. NoȌfor example, consider the children of + . Even without looking up the
Unicode codes for 3, 4 , and + , it is obvious that + isn't between 3 and 4 .
13. When it is desirable to visit the set elements in sorted order.
14. NoȌit would never be able to tell two coins apart. Thus, it would think
that all coins are duplicates of the first.
15. A priority queue is appropriate because we want to get the important events
first, even if they have been inserted later.
16. Yes, but a binary search tree isn't almost filled, so there may be holes in the
array. We could indicate the missing nodes with null elements.
17. Heapsort requires less storage because it doesn't need an auxiliary array.
18. The MinHeap wastes the 0 entry to make the formulas more intuitive.
When sorting an array, we don't want to waste the 0 entry, so we adjust the
formulas instead.
Search WWH ::




Custom Search