CS251 Data Structure: Big-O / Big-Theta notation

User Generated

1346586_

Computer Science

Description

needs two visions of answer, one to submit as requested in the assignment and one with explanation for me to understand the material.

Unformatted Attachment Preview

CS251 - Written HW2 [Designed to help prep for Exam1!] Due: ​Saturday Feb 23 by 11:59PM​ Sunday Feb 24 by 11:59PM Submission: will be through gradescope TOTAL POINTS: 220 NOTE: This problem set includes "algorithm design" problems. An appendix has been included at the end of this handout to help you in writing clear algorithm descriptions (which are not the same as "programs"). PROBLEM 1 (60 pts.): ​For each of the functions below, give as tight a worst-case r ​ untime bound as you can. Express your answers with Big-O / Big-Theta notation. Since you are seeking "tight" bounds, your answers should be expressed using Big- Θ -- unless you are especially candid and aren't sure if your upper-bound is indeed tight, you might say something like "I know the worst case is O(), but I have not been able to show that this is a tight bound..." ● Show your reasoning and ● express your answers in the ​SIMPLEST TERMS POSSIBLE!! // 7 points int A(int a[], int n) { int x=0, i, j; for(i=0; i
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Here is the assignment :) .. Kindly see attached file :)

DATA STRUCTURE
PROBLEM 1 (60 pts.):
For each of the functions below, give as tight a worst-case runtime bound as you can. Express
your answers with Big-O / Big-Theta notation. Since you are seeking "tight" bounds, your
answers should be expressed using Big- Θ -- unless you are especially candid and aren't sure if
your upper-bound is indeed tight, you might say something like "I know the worst case is O(),
but I have not been able to show that this is a tight bound..."
● Show your reasoning and
● express your answers in the SIMPLEST TERMS POSSIBLE!!

Answer:
First program:
int x=0,i,j; -> 3 declaration, 1 initialization
for (i=0;i 1 initialization
i 1 comparison...


Anonymous
Nice! Really impressed with the quality.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags