Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in clojure Write a procedure, (my-max p v1 ...), of two or more arguments. Include unit tests. The first argument will be a predicate,
" in clojure"
Write a procedure, (my-max p v1 ...), of two or more arguments. Include unit tests. The first argument will be a predicate, p, indicating a greater than relationship. my-max must return the largest of its subsequent arguments according to p. In the event of a tie (a <= b and b <= a so a = b) my-max must return the first occurrence of the largest value. Sample runs: > (my-max > 9 1 2 3 17 7 9) 17 > (my-max (fn [s1 s2] (> (count s1) (count s2))) "Hello" "Goodbye" "Frog" "Cat" "Dog" "Eybdoog")) "Goodbye"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started