Advanced Data Structures and Algorithm Analysis: Classwork Session 1 - Prof. R. Shah, Study notes of Computer Science

Various exercises related to big-o notation and searching in arrays and monotonically sorted matrices. Topics include the analysis of summations, big-o bounds, and searching algorithms.

Typology: Study notes

2010/2011

Uploaded on 09/06/2011

joshbret10
joshbret10 🇺🇸

5

(1)

7 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
CSC 3102
Adv Data Structures and
Algorithm Analysis
Classwork Session 1
pf3
pf4
pf5

Partial preview of the text

Download Advanced Data Structures and Algorithm Analysis: Classwork Session 1 - Prof. R. Shah and more Study notes Computer Science in PDF only on Docsity!

CSC 3102

Adv Data Structures and

Algorithm Analysis

Classwork Session 1

Show the following bound:

1. k=1 to n k = 1+2+3+...+n = (nn^2 )

2. k=1 to n k^2 = 1+4+9+...+n^2 = (nn^3 )

Exercise on  notation

Big-O exercise

  • (^) If d(nn) is O(nf(nn)) and e(nn) is O(ng(nn)

show that :

  • (^) d(nn) + e(nn) is O(nf(nn) + g(nn) )
  • (^) d(nn)e(nn) is O(nf(nn)g(nn))
  • (^) Is this true?
  • 2 d(nn)^ is O(n2f(nn))

Searching

  • (^) Array A was supposed to be like
    • (^) A[i] = i
    • (^) However, due to an error one value

went missing so A[i] =i for i<k and

A[i] = i+1 for the rest.

  • (^) We have to find this missing value k
  • (^) Example : the missing value is 5 1 2 3 4 6 7 8 9 10 11 i = 1 2 3 4 5 6 7 8 9 10
A[i]=

Monotone Matrix