Previous Lecture | lect14 Before Slides | lect14 Annotated Slides | Next Lecture |
Code from lecture
https://github.com/ucsb-cs16-wi17/lecture-02-23
Topics
- Thinking recursively about problems on sequences
- Recursion vs. iteration via examples: printing elements of an array in order and in reverse order, printing elements of a linked-list in order and in reverse order
- How do we know our recursive solution is correct? Proof by induction
- Is recursive better than iterative?
- Problems that have a naturally recursive solution
- Under the hood of recursive functions (how recursive functions use the stack)
- Helper functions
- Recursion on strings
- char arrays, C-strings and string literals
- Basic operations on C-Strings using the cstring library functions
- String class objects and methods (similarities and differences with c-strings)
- Intro to lab08