Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Lecture 7 | Programming Abstractions (Stanford)

Loading...

Sign in or sign up now!
19,336
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jul 16, 2008

Lecture 7 by Julie Zelenski for the Programming Abstractions Course (CS106B) in the Stanford Computer Science Department.

Julie explains the idea of functions as data and specific plot functions and continues onto client feedback functions and ADTs. She then delves into recursion and solving problems using recursion.

Complete Playlist for the Course:
http://www.youtube.com/view_play_list?p=FE6E58F856038C69

CS 106B Course Website:
http://cs106b.stanford.edu

Stanford Center for Professional Development:
http://scpd.stanford.edu/

Stanford University:
http://www.stanford.edu/

Stanford University Channel on YouTube:
http://www.youtube.com/stanforduniversity/

Category:

Education

Tags:

Download this video

LICENSE: Creative Commons (Attribution-Noncommercial-No Derivative Works).

For more information about this license, please read: http://creativecommons.org/licenses/by-nc-nd/3.0/.

High-quality MP4 Learn more

  • likes, 0 dislikes

Link to this comment:

Share to:

Top Comments

  • Yes, that is what was happening in the constructor for Set.

    Set(int (cmpfn)(ElemType, ElemType) = OperatorCmp);

    OperatorCmp is the template function that just uses the built in operators.

  • Does any one know if you can assign a default callback function in the function declaration?

    i.e.

    void function(int a, int (fn)(int,int) = &sum)

see all

All Comments (12)

Sign In or Sign Up now to post a comment!
  • I think you give wrong idea about recursion. You shouldn't put it in your toolbox as something to use all the time to solve all these great problems. It should generally be avoided. All problems can be solved without it, and most should. It makes ugly hard to find bugs, and code that doesn't make sense at first glance. Not to mention even modern compilers can't optimize it very well. So that leaves "elegant" (hard to understand) code that runs slow.

  • You should not explain recursion as a mysterious indespensible tool that lets you solve infinite problems that were previously unsolvable. Its a loop with a stack. Which is surprising you don't just point this out, because you just taught what a stack is! I don't understand why schools start with high level languages and go down, much easier starting low and learning high.

  • Agree, two thumbs up.

  • !!This student with the mc who is always coughing is very annoying

  • At about 22:00 there is a nice example developped on how finding with a dictionary all anagrams of different words quickly, using map and set.

    Of course Map and Set are from the course library not the STL. but the code is quite simple and is done step by step (with some classic errors like passing by reference) and fairly mutable to use the Standard Template Library.

  • listen carefully at 9:54 lol she sais F'n A lol

  • That example for campus survey is more like a map-reduce than a recurssion... I think..

Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more