Discussion:
A8Q3
(too old to reply)
Raymond
13 years ago
Permalink
I been doing this question for a while now but I am still unable to
figure out a method to do the confirm to see if the input is within the
current order-list. Also are we allow to use mutation?

Any type of hint would be appreciated

Thanks,
Raymond
Dan Lizotte
13 years ago
Permalink
Post by Raymond
I been doing this question for a while now but I am still unable to
figure out a method to do the confirm to see if the input is within the
current order-list.
;; (os-member s e) produces true if e is a member of s; false otherwise

;; (os-after s e) produces the to-min element of s which is to> than e
;; running time: O(log |s|)
;; (os-before s e) produces the to-max element of s which is to< than e

These are potentially useful for determining if something you want is in
your set.

Also are we allow to use mutation?

Yes, but you probably don't need to. If you find yourself mutating a
global variable in scheme you may want to consider passing it as an
accumulator instead; this is frequently easier to debug.

Loading...