Question: Write a recursive scheme function EXP-DEPTH that returns the depth of the most nested parentheses in a list. (EXP-DEPTH A) is 0, (EXP-DEPTH ( ))
Write a recursive scheme function EXP-DEPTH that returns the depth of the most nested parentheses in a list. (EXP-DEPTH A) is 0, (EXP-DEPTH ( )) is 1, (EXP-DEPTH (1 2 3) ) should return 1. (EXP-DEPTH (I J ((K) L) M)) should return 3, since the element K is nested in three levels of parentheses.
Write a scheme function (EXP-EVAL) which evaluates an arithmetic expression. The binary operators used for an arithmetic expression are: +, -, *, and /. (EXP-EVAL (2 + (3 * 5))) should return 30.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
