SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 05 Jan 2018 My Price 7.00

Give a big-Oh characterization, in terms of n,

1. Show that if d(n) is O(n)) and e(n) is O(g(n)), then the product d(n)e(n) is O(n)g(n)).

2. Give a big-Oh characterization, in terms of n, of the running time of the Ex1 function shown in Code Fragment 4.6.

Code Fragment 4.6: Some algorithms.

Algorithm Ex1(A):

Input: An array storing ≥ 1 integers.

Output: The sum of the elements in A.

sA[0]

fori←1to n−1 do

ss+A[i]

returns

Algorithm Ex2(A):

Input: An array storing ≥ 1 integers.

Output: The sum of the elements at even cells in A.

sA[0]

fori←2to n−1 by increments of 2 do

ss+A[i]

returns

Algorithm Ex3(A):

Input: An array storing ≥ 1 integers.

Output: The sum of the prefix sums in A.

s←0

fori←0to n−1 do

ss+A[0]

forj←1 to do

ss+Aj]

returns

Algorithm Ex4(A):

Input: An array storing ≥ 1 integers.

Output: The sum of the prefix sums in A.

sA[0]

ts

fori←1to n−1 do

ss+A[i]

t+s

returnt

Algorithm Ex5(A,B):

Input: Arrays and each storing ≥ 1 integers.

Output: The number of elements in equal to the sum of prefix sums in A.

c←0

fori←0to n−1 do

s←0

forj←0 to n−1 do

ss+A[0]

fork←1to do

ss+A[k]

ifB[i] = then

cc+1

returnc

 

 

Answers

(5)
Status NEW Posted 05 Jan 2018 01:01 PM My Price 7.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)