Question: Write a predicate mydecode / 2 that takes the compressed list as a first parameter and returns the uncompressed list as shown as the second
Write a predicate mydecode that takes the compressed list as a first parameter and returns the uncompressed list as shown as the second parameter. For example:
mydecodeX should yield X
mydecodeabcdX should yield X abbcccdd
mydecodeapleX should yield X apple
In Prolog please
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
