Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

iPad 11:47 PM 95% Back (3) (list (6) (13 5)) 2. Find the sequence of CARs and CDRs that return X when applied to he

image text in transcribed
iPad 11:47 PM 95% Back (3) (list (6) (13 5)) 2. Find the sequence of CARs and CDRs that return X when applied to he following S-expressions. (1) ((A B) (AXC) D) (2) (A ( (C D C (X) D))) (4) ((AB)CDXD) (6) (A((CD (X) D 3. Write a recursive function to count the number of the elements of a list. Please name the function as count- elements. This function should tell how many elements are contained in a list. For example, (count-elements (a (b c) (d (e) f))) returns 3. Write a recursive function to count the number of the atoms that appear at all levels of an S-expression. Please name the function as count-atoms. This function should tell how many atoms are contained in a s- expression. For example, (count-atoms (a (b c) (d (e) f))) returns 6 Write a recursive function to get the maximum number from a sequence of numbers. function as max. This function should tell the maximum number in a given list. For example, (max (5693 6)) will result in 9. 4. 5. Please name the 6. Write a Scheme program for Fibonacci numbers. The Fibonacci numbers are defined as follows: Fibonacci(n) 0 ifn1 - Fibonacci(n-1) Fibonacci(n-2) if n>2 7 Write a recursive function to get the minimum number from a sequence of numbers. Please name the function as min. This function should tell the minimum number in a given list. For example, (max (57936)) will result in 3 8. What does the following recursive Scheme function do (define (TEST L) (if (null L) nil (if ( atom L) 'Not A LIST (if (null (cdr L)) (car L) (TEST (cdr L))

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

Design a job advertisement.

Answered: 1 week ago

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago