Feb 1
discuss homework
How far did you get?
more C
multiple files :
- .h files
- make and Makefilefd
pointers :
char* name = "Jim Mahoney";
int* list1; // all three essentially same
int *list2; //
int list3[]; //
Note that none of those three actually creates space for an array;
they all set up a place for a pointer to an integer.
Which can be also be a pointer to the first of many integers,
i.e. an array.
int x = 3;
int* x_ptr = &x;
*x_ptr = 7; // the value of x is now changed.
int foo[3] = {10, 11, 12}; // curlies only during initialization
foo[1] = 21; // modify middle entry
*(foo +2) = 7; // same(!!) : "dereference 2 integers past foo"
I attached the play.c that we did in class.
work through my C code
Discuss mercurial, and code repositories briefly.
discuss quicksort, radix sort
quicksort:
- The central idea is a "pivot": sort numbers below, numbers above into two sublists. And can be done in place!
- wikipedia: quicksort
radix sort:
- If you have unique integers and enough space to number 'em all, you can just plop 'em in place.
- Or, you can sort into bins digit by digit in (say) base 10, so that up to 1000 can be done in 4 passes. But
- So is it linear time? Hmmm.
- wikipedia: radix sort
Both of these are average O(n log(n)); both are good depending on situation.
And both are "divide and conquer" algorithms.
fourier
Review: complex numbers, complex exponentials, vectors, dot products, and finding components.
Discuss continuous vs discrete representations of functions f(time) and F(freq). Start building some intuition for the big ideas.
(Probably on Thu) work out the fourier transfer relations.