# Lect2 - Data Structures CSC212 1 Fundamental Concepts Some...

This preview shows pages 1–6. Sign up to view the full content.

1 Data Structures CSC212

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Fundamental Concepts Some fundamental concepts that you should know: Dynamic memory allocation. Recursion. Performance analysis.
3 Performance Analysis There are problems and algorithms to solve them. Problems and problem instances . Example: Sorting data in ascending order. Problem: Sorting Problem Instance: e.g. sorting data (2 3 9 5 6 8) Algorithms: Bubble sort, Merge sort, Quick sort, Selection sort, etc. Which is the best algorithm for the problem? How do we judge?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Performance Analysis Two criteria are used to judge algorithms: (i) time complexity (ii) space complexity. Space Complexity of an algorithm is the amount of memory it needs to run to completion. Time Complexity of an algorithm is the amount of CPU time it needs to run to completion.
5 Space Complexity Memory space S(P) needed by a program P, consists of two components: A fixed part: needed for instruction space (byte code), simple variable space, constant space etc. c A variable part: dependent on a particular instance of input and output data. S p (instance) • S(P) = c + S p (instance)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/18/2010 for the course COMPUTER S CSC212 taught by Professor Shah during the Winter '09 term at King Saud University.

### Page1 / 19

Lect2 - Data Structures CSC212 1 Fundamental Concepts Some...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online