20-CS-122-001 Computer Science II Spring 2012
Turn English Into Code

Virtual functions, classes, inheritance, lists, queues, stacks, applications

Prev      Next
Objects:     class Cable { ... };
Number of objects (cables):     int n;
Identify Sets:     Cable **cable = new Cable*[n];
Repeat:     for (int i=0 ; i < n ; i++) { ... }
Lowest cost cable:     qsort(cables, n, sizeof(Cable*), cmp)
Does adding a cable...     if (!cycle_caused_by_adding(cable[i])) { ... }
Add to set:     cable[i]->solut = true