Hi,
I didn't get the all concept of Complexity
For eaxample, in those codes i wrote:
(define (prefix k lst)
(cond ( (= k 0) '())
( (null? lst) '())
(else (cons (car lst) (prefix (- k 1) (cdr lst))))))
(define (runs k lst)
(let ((p (prefix k lst)))
(if (> k (length p)) '()
(cons p (runs k (cdr lst))))))
-----------
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(define (accumulate-runs k op init lst)
(map (lambda (x) (accumulate op init x))
(runs k lst)))
---------------
How can i determine the complexity in both of those codes?
Thanks for any kind of help:)
Complexity
Started by infimum, Dec 22 2009 09:46 AM
1 reply to this topic


Sign In
Create Account

Back to top









