Question: ( define ( trace - 3 d x ) ( if ( null ? x ) 0 ( + ( trace ( car x )

(define (trace-3d x)
(if (null? x)
0
(+(trace (car x))(trace-3d (cdr x)))))
(define (trace matrix)
(if (null? matrix)
0
(+(caar matrix)(trace (map cdr (cdr matrix))))))
(define example-matrix
'(((123)(456)(789))
((111213)(141516)(171819))
((212223)(242526)(272829))))
(display "Matrix:")
(display example-matrix)
modify this code to make the output: (((1516)(1819))((2526)(2829)))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!