Question: 1. Factorial can be computed iteratively (with a loop) or recursively. Which approach will produce a better result in most cases? Explain the problems with
1. Factorial can be computed iteratively (with a loop) or recursively. Which approach will produce a better result in most cases? Explain the problems with the approach that you think is worse Why did we decide to keep a count of the items within our data structures as an attribute? 3. If we did NOT keep the count in an attribute, what would the Big-O of the get size method be for 2. the queue, stack, and binary search trees? Hint: It would be the same. whle sthe if theses method w do ac 5. What is the Big-O of enqueue method of a queue when implemented as a linked list with and without a pointer to the end of the list? With a pointer to the end Without a pointer to the end: performance in time. List the best case and the worst case performance for adding a value to a Ordinary Binary Search Tree 6. Adding, removing, and finding values in a binary search tree have the Big-O valuefor +balanced and ordinary (unbalanced) binary tree. Hint: They are different Best Case Worst Case Balanced Binary Search Tree .In a binary search tree, while attempting to find a value, how does the program determine that the value is not in the tree? 8. What are the two types of heaps? What is the different? Why descnbe the tree on which the heap is patterned to be "complete, or nearly somalste Whst does "complete, or nearly complete mean? 10. In a heap, where do we place the new item initially
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
