Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SML 5.isPalndrome-20% A palindrome is a sentence or phrase that is the same forwards and backwards, ignoring spaces, punctuation and other special characters, and upper

image text in transcribed

SML

5.isPalndrome-20% A palindrome is a sentence or phrase that is the same forwards and backwards, ignoring spaces, punctuation and other special characters, and upper vs. lower case. In this problem we will consider palindromes that include only letters, digits, and spaces but don't include any punctuation or any special characters - for example "a01 02 2010A", "Yreka Bakery", and "Doc note I dissent a fast never prevents a fatness I diet on cod". Assume that letters are case insensitive- for example "Madam Im Adam" Write an ML function isPalindrome that takes a string as argument and that returns true if the string is a palindrome and false otherwise. (Note: you can make use of the following ML functions rev (for reversing a list), String.explode (for retrieving the list of characters in a given string), and Char.toUpper (for retrieving the uppercase of a given character).) The type of isPalindrome should be: string bool. Examples isPalindrome"a01 02 2010A" true > isPalindrome "Doc note I dissent a fast never prevents a fatness I diet on cod" true

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

More Books

Students also viewed these Databases questions

Question

How does the scientific attitude contribute to critical thinking?

Answered: 1 week ago

Question

107 MA ammeter 56 resistor ? V voltmeter

Answered: 1 week ago

Question

Generally If Drug A is an inducer of Drug B , Drug B levels will

Answered: 1 week ago

Question

Distinguish between filtering and interpreting. (Objective 2)

Answered: 1 week ago