Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Complexity - Data Structures - Lecture Slides, Slides of Data Structures and Algorithms

In the subject of the Data Structures, the key concept and the main points, which are very important in the context of the data structures are listed below:Complexity, Sorting Program, Data Set, Multiplying, Experiment, Types of Complexity, Space Complexity, Program, Runtime Complexity, Factors

Typology: Slides

2012/2013

Uploaded on 04/23/2013

saratey
saratey 🇮🇳

4.3

(10)

87 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Complexity - Data Structures - Lecture Slides and more Slides Data Structures and Algorithms in PDF only on Docsity!

What is complexity^ ^ Consider a sorting program that runs on a data set^ ^ Try multiplying the size of the data set and continue toexperiment^ ^ What happens??^ ^ Demo

What Factors Determine theruntime of a program?

Among all those factors^ ^ Size of the data set is one factor that we can analyze^ ^ That is, we can describe the runtime as a function of n(size of the data set)^ ^ Example:^ ^ for (int i=0; i<n ; i++)^ ^ Do_something^ ^ for (int i=0; i<n ; i=i/2)^ ^ Do_something

Definition of Big O^ ^ Formal Definition:

f(n) = O(g(n)) means there are positive constants c and k, such that 0 ≤ f(n) ≤ cg(n)for all n ≥ k. The values of c and k must be fixed for thefunction f and must not depend on n. 

Complexity of basic algorithms^ ^ Finding an element in an unsorted array of size n^ ^ Finding an element in a sorted array of size n^ ^ Reversing an array of size n^ ^ Sorting an array of size n

Determining big O

Final Thoughts^ ^ Asymptotic analysis is a way to determine theperformance of an algorithm^ ^ However, it is not the only factor that affectsperformance^ ^ For the most part other factors also have a significantimpact on performance of systems^ ^ Network latency^ ^ Language efficiency^ ^ Data Structures^ ^ Many many other factors