Students give feedback about what problems they are having with machine code. Most problematic topic seems frames. Richard revises: what *is* a frame? how is a frame used? roles of the calling function and the called function. what is the return address and how is it used? what is the frame pointer and how is it used?
Backtracking Pseudocode, Sudoku Solver, Sudoku Code, Cryptarithmetic, Dumb Solver, Smarter Solver, Looking for Patterns, Introduction to Pointers, Single Pointer Operations
Review and discussion of sudoku code from last lecture. Backtrack vs brute force. Course waffles. Stacks, "the stack" in memory, Buffer overflows. Also: the course ENGG1000, wiki textbook (idea from hong kong). Predicates, comparing with TRUE. Stack overflow.
Tim explains pass by reference and the link between arrays and pointers. Using sample code we see that C passes arrays into functions *by reference*, unlike all the other types we have seen so far.
Topics: Welcome to CS106A, Course Staff, Why is the class called Programming Methodology?, Are you in the right class?, Class Logistics, Assignments and Grading, Extensions, Midterm and Final, Grade Breakdown, The Honor Code, Why Karel?
Hamming codes, parity bits, magic. Detecting errors when transmitting information. Even better: correcting errors.
Strings, elements and layout of a c program. using gcc, comments, ints, printf, scanf, main, #include, printing newlines. Discussion of clarity. also: about transistors, compiling, machine code
How a C function call is implemented in machine code. frames. role and responsibilities. Abstraction revisited. Scope revisited. This is the first part of lecture 12.
Heap Management - How Information about Allocations are Stored in the Heap, Result of Freeing Memory Improperly, Actual Sizes of Heap Allocations - Nearest Power of 2, Management of Free Blocks on the Heap by Storing Addresses in the Blocks of Free Memory, Algorithms for Choosing Which Free Block to Allocate, How the Heap's Free List Can Be Updated When Memory is Freed, How Adjacent Free Blocks Are Combined To Avoid Fragmentation, Compacti...more
Selection Sort, Live Demo: Working/execution of the Code, Selection Sort Analysis, Insertion Sort Algorithm, Live Demo: Working/execution of Insertion Sort, Insertion Sort Analysis, Insertion vs Selection, Quadratic Growth of the Algorithm, Merge Sort, Merge Sort: Working/execution Demo, Merge Sort Code Explanation, Merge Sort Analysis, Quadratic vs Linear Arithmetic, Sort 'Race', Quick Sort Idea