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

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

View Full Document Right Arrow Icon
1 Data Structures CSC212
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Fundamental Concepts Some fundamental concepts that you should know: Dynamic memory allocation. Recursion. Performance analysis.
Background image of page 2
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?
Background image of page 3

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

View Full DocumentRight Arrow Icon
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.
Background image of page 4
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)
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
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 Right Arrow Icon
Ask a homework question - tutors are online