
Class 28. Topics Not Covered
•A one-semester course is not nearly long enough to touch on all the variety of topics
in computational astrophysics, nor to go into any great detail on very many of them.
•Below is an incomplete list of topics we did not get a chance to cover that are of
possible interest. Hopefully the list will reveal new ideas not previously considered, or
at least serve as a starting point for trying out other computational courses.
Algorithms
Sorting
•Cf. NRiC §8.
•Well-known algorithms:
1. Bubble Sort — O(N2)
2. Quicksort — O(Nlog2N)
–Recursive method (divide and conquer).
–Implemented on most Unix systems as qsort():
void qsort(void *base,size_t nmemb,size_t size,
int(*compar)(const void*,const void *));
–The comparison function returns an integer <, ==, or >0 if the first argu-
ment is considered to be respectively <, ==, or >the second.
3. Heap Sort — O(Nlog2N)
–Sorts in place; no auxilliary storage required.
•Hashing
Interpolation and extrapolation
•Cf. NRiC §3.
•Many applications, including fitting unevenly spaced data to a regular grid (recall
FFT).
Minimization and maximization (optimization)
•Cf. NRiC §10.
•We saw this in the context of modeling data.
•New cool method: simulated annealing.
–Good for finding global minima (e.g., travelling salesman problem, which is NP-
complete and therefore has ∼exp(const.×N) possible combinations, where Nis
the number of cities to visit—Cf. NRiC §10.9).
1