Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming 3 0 . ( 8 pts ) In the space below, write a function called maxIncCount in OCam l F # , which :

Programming
30.(8 pts) In the space below, write a function called maxIncCount in OCamlF#, which :
Accepts a predicate function and a single list of integers. (You may assume the list has at least one element.)
Resolves to a integer count of the longest consecutive sequence of increasing integers matching the predicate.
The function should utilize pattern matching and recursion and not use any "mutable" values/variables.
For example, the result would equal 3 after the function call below:
let result = maxIncCount (fun xx>0
Reason: The 3 consecutive values 2;4;6 represent the longest run of integers greater than 0.
image text in transcribed

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions