Homework Assignment 2

Answer each of the questions below and submit your answers as a PDF document through Canvas by the due date. You may submit a scanned handwritten document from this assignment, but do not choose a very high resolution (above 300dpi) and scan all pages as portrait.

- Consider the following recursive algorithm:

Algorithm Traverse(b: BinaryTree): set global count to 1

if b is empty return

Traverse(b left subtree) mark root with count increment count Traverse(b right subtree) return

Answer the following questions

- What are the base or terminating statements of the algorithm?
- What are the recursive statements of the algorithm?
- What statements perform the non-recursive work of the algorithm?
- Consider the binary tree shown Indicate how the algorithm will number the nodes by tracing the algorithm’s execution on the tree.
- Consider the function (f (n)=4 x4−50 x3−1000 ) . Find the lower asymptotic bound ( Ω(g) ) and show that g is the lower bound using the definition of Ω (find a constant c>0 such that f (n)>g (n) for all n >n 0 for some constant n0> 0 . Then use the method of limits to show that f ∈Ω(g) .
- Consider the algorithm below:

Algorithm X(b : BinaryTree) if b is empty

return 0

lc = X( left subtree of b) rc = X( right subtree of b) return lc + rc + 1

Prove that this algorithm returns the number of nodes in the binary tree using induction.

- Find closed form solutions (solutions that do not have the summation symbol) for the following series. Use the basic series solutions in Chapter 1 of your textbook

CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,

Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This

7COM1028 Secure Systems Programming Referral Coursework: Secure

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme