1. Engineering
  2. Computer Science
  3. can some one please help me with this the functions...

Question: can some one please help me with this the functions...

Question details

Here is an example of using the llisting package to display code. Check the preamble to see where this is imported and set up. After that you will see a sample interaction from the DrRacket console to show how this function could be tested. You should for each of the functions in this exercise provide similar listings and output 1 (define (tailcountif x 1) 2 (define (tcount x l n) (cond ((empty? 1) n) ((x (car1)) (tcount x (cdr 1) ( 1 n))) (true (tcount x (cdr 1) ))) 6 (tcount x 1 0)) > (tailcountif 2 (list 1 2 3 1 2 3 2 4 5 2 3)) 4 > (tailcountif 5 (list 1 2 3 1 2 3 2 4 5 2 3)) (tailcountif 6 (list 1 2 3 1 2 3 2 4 5 2 3)) 0 > (tailcountif 2 ) > (tailcountif 2 (list 3)) > (tailcountif 2 (list 2)) Complete definitions for each of the functions listed below, including for each code listing and testing as shown above 1. (gcd a b) a function that computes the greatest common divisor of two integers using the Euclidean Algorithm. You may assume a is greater than 0 and b is greater than or equal to Solution: 2. (fastexp a b n) - a function that computes ab %sing the fast exponentiation algorithm You should use the Racket functions quotient and remainder for integer arithmetic. Solution: 3. (is-sorted? 1, pred) - a function that determines whether of not the list l is sorted where the order is determined by: p comes before q when (pred p q) has value#t . Solution:

Can some one please help me with this? the functions should be coded in the Racket programming language using DrRacket.
help is appreciated. Thank you!!

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution