Lecture: Writing a Recursive Power Set Function in Scheme

Jerry Cain - Stanford

 
Previous LectureNext Lecture

Description

Lecture Description

Writing a Recursive Power Set Function in Scheme, Using a Lambda Mapping Function that Cons-Es the Car to Every Element in the Power-Set of the Cdr to Make the Recursive Step in the Power-Set Function, Using a Let Binding to Cause Power-Set to Only Make One Recursive Call Rather than Two, Structure of a Let Binding, How Expressions Within a Let Binding Cannot Depend On Each Other Unless the Let* Keyword Is Used, How a Let Binding Is Compiled to the Evaluation of a Lambda Expression, Writing a Permute Function, Which Prints Out a List of All Permutations of a Given List, Writing a Permute Function, Which Prints Out a List of All Permutations of a Given List, Writing the Overall Algorithm For the Permutation Function, Which Maps a Function Over Each Element in the List that Produces Each Permutation Starting With that Element, then Appends the Results Together, Writing the Mapping Function For the Permute Function, Which Maps Another Function (That Simply Conses the Current Element) to Each Permutation of the List of Elements when the Current Element Is Removed, Coding Without Side Effects and Immutability of Lists in Scheme, Memory Allocation in Scheme and the Read-Eval-Print Loop, How Integers, Strings, and Lists Are Laid Out in Memory when They Are Typed into the Scheme Command Line

Course Description

Topics include: Advanced memory management features of C and C++; the differences between imperative and object-oriented paradigms; the functional paradigm (using LISP) and concurrent programming (using C and C++); brief survey of other modern languages such as Python, Objective C, and C#.

Prerequisites: Programming and problem solving at the Programming Abstractions level. Prospective students should know a reasonable amount of C++. You should be comfortable with arrays, pointers, references, classes, methods, dynamic memory allocation, recursion, linked lists, binary search trees, hashing, iterators, and function pointers. You should be able to write well-decomposed, easy-to-understand code, and understand the value that comes with good variable names, short function and method implementations, and thoughtful, articulate comments.

from course: Computer Science III: Programming Paradigms

Comments

Related Lectures