1
h09
CS16 F18
Name:
(as it would appear on official course roster)
Umail address: @umail.ucsb.edu section
Optional: name you wish to be called
if different from name above.
Optional: name of "homework buddy"
(leaving this blank signifies "I worked alone"

h09: Chapter 14: Recursion

ready? assigned due points
true Thu 11/29 12:30PM Wed 12/05 12:30PM

You may collaborate on this homework with AT MOST one person, an optional "homework buddy".

MAY ONLY BE TURNED IN IN THE LECTURE/LAB LISTED ABOVE AS THE DUE DATE,
OR IF APPLICABLE, SUBMITTED ON GRADESCOPE. There is NO MAKEUP for missed assignments;
in place of that, we drop the three lowest scores (if you have zeros, those are the three lowest scores.)


Please:

  • No Staples.
  • No Paperclips.
  • No folded down corners.

Read Chapter 14 and the lecture notes. You don’t need to turn this homework in. Please turn in the physical copy of your homework in person. Write in PEN or DARK PENCIL.

PLEASE MARK YOUR HOMEWORK CLEARLY, REGARDLESS OF IF YOU WRITE IT OUT IN INK OR PENCIL! FOR BEST RESULTS, SAVE THIS PAGE AS A PDF, THEN PRINT THE PDF.

1.(2 pts) How does a recursive function know when to stop recursing?

2.(3 pts) What is a LIFO scheme and how does it relate to stacks?

3.(3 pts) What is stack overflow?

4.(7 pts) Write a recursive function to count the number of vowels in a string.

5.(10 pts) Write a recursive function to search for a given value in a linked list. The function should return True if there is at least one node with the given value. Otherwise it should return False. Use the definitions of LinkedList and Node from lab07 for this questions 5 -7.

bool findNode(Node* head, int value){

6.(10 pts) Write a recursive function that counts the number of nodes with odd values in a linked list.

7.(15 pts) Write a function that deletes all the nodes with a given value in a linked list and returns a pointer to the new head of the list.

Node* deleteNode(Node* head, int value){