cs lecture tutorial dec 2

# cs lecture tutorial dec 2 - cs lecture/tutorial dec 2 void...

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

cs lecture/tutorial dec 2 void quicksort(int a[],int n) { typical case O(n logn) searching/sorting -big-O notation -linear search o(n) -binary search(sorted array), O(log n) -selection sort -bubble sort O(n^2) -insertion sort (worst case) -mergesort (needs temp array) O (nlog n) worst case -quicksort-typical is O(n logn) worst case (n^2) Summary -ch. 2-7 (fundamentals) -vars, types, expression -if, loops, printf, scanf(%d,&g) -int, char, double Section 8.1 -arrays, (no multi-dimensional arrays) chapter 9 -functions -recursion -quicksort skim chapter 10 -program organization (no global variables) midterm chapter 11 and 12 -pointers and arrays (no 12.4/12.5) chapter 13-strings chapter 15 –header files section 16.1/16.2 –structs (no enums/unions) sections 17.1 -> 17.4

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

View Full Document
-dynamic memory -pointers to functions (no linked lists) section 23.3 -math.h section 25.2 -unicode/UTF-8 Algorithms -Euclid (GCD) -Big-O/sorting/searching -bisection/fixed point iteration -page rank -etc Sorting in reality In memory -quicksort for larger n (n>10ish) qsort
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 12/10/2011 for the course CS 137 taught by Professor Clarke during the Fall '10 term at Waterloo.

### Page1 / 4

cs lecture tutorial dec 2 - cs lecture/tutorial dec 2 void...

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

View Full Document
Ask a homework question - tutors are online