Menu

Lecture 20: Car-Cdr Recursion Problem that Returns the Sum of Every Element in a List of Integers

calendar icon Sep 7, 2010 2788 views
video thumbnail
Pause
Mute
speed icon
speed icon
0.25
0.5
0.75
1
1.25
1.5
1.75
2

Okay, if I want to go ahead and do something like this, I want it to come back with a zero. And so, what I’m going to exploit here is – I think it’s something that’s pretty conceptually obvious to everyone – is that the sum of this entire list is gonna be 1 plus whatever the sum of this list is. I’m gonna exploit the fact that cuda is available to me, and it’s very, very fast to just kind of recurse on the tail of the list. For the implementation, is this right here. If it is the case that null of num list passes, or comes back with a true, then it evaluates this expression. ... See the whole transcript at [[http://see.stanford.edu/materials/icsppcs107/transcripts/ProgrammingParadigms-Lecture20.pdf|Programming Paradigms - Lecture 20]]

RELATED CATEGORIES

MORE VIDEOS FROM THE SAME CATEGORIES

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 4.0 International license.