notes10 - January 20 - 22, 2010 (Notes) Program = Data...

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

View Full Document Right Arrow Icon
January 20 - 22, 2010 (Notes) “Program = Data Structure + Algorithm” (Niclaus Wirth: Author of Pascal language). Data structure – representation of a portion of the world inside the computer (relevance from reality). Algorithm – it is a transformation of the input data to the output data. Characteristics of an algorithm: o Time (seconds) – running time. How long does it take for the algorithm to complete (more critical). o Space (bytes) – computer storage needed to run the algorithm. In this course, we will put more emphasis in execution time ; space is also important, but not as much as time. Types of running time: o Worst case o Average case o Best case time can be measure experimentally using inputs of different sizes and measuring the time. In “UNIX” you can use the “time” command: o bash> time gcc –o x x.c (print time it takes for the compiler to compile x.c) o bash> time ls –R / >/dev/null (no output) o this will give: user time – time spent by program in user mode
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/02/2012 for the course CS 251 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 2

notes10 - January 20 - 22, 2010 (Notes) Program = Data...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online