Question: THIS PROGRAM MUST BE WRITTEN IN RACKET PROGRAMMING LANGUAGE Write a recursive function listLength that counts the number of items in a list.You may not

THIS PROGRAM MUST BE WRITTEN IN RACKET PROGRAMMING LANGUAGE Write a recursive function listLength that counts the number of items in a list.You may not use the racket function length. Write a recursive function deepListLength that return the number of atoms (things that are not lists) in a list.

Examples:

(listLength '(1 2 3 4)) returns 4

(listLength '(1 (2 3) (4 (5 6)))) returns 3

(deepListLength '(1 2 3 4)) returns 4

(deepListLength '(1 (2 3) (4 (5 6)))) returns 6

functions are not required to be tail recursive

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!