I&C SCI 46 Lecture Notes - Lecture 6: Iterated Function, Gödel, Escher, Bach, Linked List

54 views24 pages

Document Summary

In this lecture we will discuss the concept of recursion and examine recursive functions that operate on integers, strings, and linked lists, learning common idioms for each. When we cover linked lists, will first examine functions operating on linked lists that do not change their structure, and then examine functions whose purpose is to change the structure of the linked list (add or remove values). We will study how to hand simulate such functions and the three rules for proving them correct. In addition, some programming languages (lisp is the foremost example) use recursion (and also decision-if) as their primary control structures: any iterative code can be written recursively. Even languages that are not primarily recursive all support recursion (and have since the late 1950s), because sometimes using recursion is the best way to write code to solve a problem. C++ (and java/python) are not primarily recursive languages.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents