Algorithms and OOD (CSC 207 2013F) : Outlines
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Held: Wednesday, 4 December 2013
Back to Outline 50 - Heap Sort. On to Outline 52 - Dynamic Programming.
Summary
We pause for a bit to review a few concepts that have been causing folks problems.
Related Pages
Overview
Administrivia
new
or malloc
or the equivalent go on the
heap.Sample code
public class Counter {
static int operations = 0;
int counter;
void increment() {
++Counter.operations;
++this.counter;
} // increment()
void decrement() {
++Counter.operations;
--this.counter;
} // decrement()
int get() {
++Counter.operations;
return this.counter;
} // get()
} // class Counter
public class CounterExpt {
public static void main(String[] args) {
Counter c1 = new Counter();
Counter c2 = new Counter();
c1.increment();
c1.increment();
c2.decrement();
System.out.println("ops: " + Counter.operations);
System.out.println("c1: " + c1.get());
System.out.println("c2: " + c2.get());
System.out.println("ops: " + Counter.operations);
} // main
} // class CounterExpt
We'll walk through the setup of memory
Note that we can do less detail and still learn a lot.
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Java 7 API] [Java Code Conventions]
Related Courses: [CSC 152 2006S (Rebelsky)] [CSC 207 2013S (Walker)] [CSC 207 2011S (Weinman)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)] [Issue Tracker (Textbook)]
Copyright (c) 2013 Samuel A. Rebelsky.
This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this
license, visit http://creativecommons.org/licenses/by/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.