Computer Science Homework Solutions

tree structure search and update; what is big omega for depth x?

In a binary tree the search is log (x) and the update is x where x is teh depth of the tree. Is this correct? In tree like structure (tree structure) what is the maximum number of access for record update? is it x? why? what about the search? I need teh answer and also why? Thanks

Big O - algorithm comparison

Suppose program A takes (2^n)/1000 units of time and program B takes 1000(n^2) units. For what values of n does program A take less time than program B. I am really looking for a detailed explanation on this problem - to check my answer. Thanks.

Big O Problem

The following is a big-oh relationship: n^10 is O(3^n) Please give witnesses n0 and c that can be used to prove the relationship. Choose your witnesses to be minimal, in the sense that n0-1 and c are not witnesses, and if d < c, then n0 and d are not witnesses. As a side note to the problem -- it may not be clear what ...continues

Big O Problem - Proof

Show that F(n) + g(n) is O(max(f(n),g(n))). Any detail is appreciated.

Big O Problem

Show that if: T(1) = a T(n) = T(n-1) + n^k, for n > 1 then T(n) is O(n^(k+1)). You may assume k>=0. Also, show that this is the tightest simple big-oh upper bound, that is, that T(n) is not O(n^m) if m < k+1. Hint: Expand T(n) in terms of T(n-i), for i = 1,2,..., to get the upper bound. For the lower bound, show that ...continues

Big O Problem

Consider the recurrence T(1)=a T(n)=cT(n/d)+bn^k, for n a power of d Iteratively expand T(n) in terms of T(n/d^i) for i=1,2,.... Show that a) if c > d^k, then T(n) is O(n^logd c) b) if c = d^k, then T(n) is O(n^k log n) c) if c < d^k, then T(n) is O(n^k)

convert structure to matlab m-file

Convert the following structure plan into a function m-file with two inputs (M and N): Get M and N values if M does not equal round(M) Give error message that inputs must be integers end if if N does not equal round(N) Give error message that inputs must be integers end if while remainder of M divided by N is not ...continues

Objects and classes

Design an inventory Class that can hold information and calculate data for items in a hardware store's inventory. The Class should have the following private member attributes: (See attachment for full question)

Pleaes provide the following information

Describe a situation or program that would use a decision structure and a loop.

Browse