This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
cs330_f2016:racketlists [2018/09/13 21:34] morse |
cs330_f2016:racketlists [2018/09/13 22:07] morse |
||
---|---|---|---|
Line 30: | Line 30: | ||
** | ** | ||
You must write all of these functions recursively (though you can use helper functions as needed). | You must write all of these functions recursively (though you can use helper functions as needed). | ||
+ | |||
You may not use higher-order functions like ''map'', ''filter'', or any of the variants of ''fold''. You may not use functions that use or return indices, such as ''index-of'' or ''list-ref''. | You may not use higher-order functions like ''map'', ''filter'', or any of the variants of ''fold''. You may not use functions that use or return indices, such as ''index-of'' or ''list-ref''. | ||
+ | |||
+ | You may not use anything that modifies a value in place such as ''set!'' or list-modification operators. | ||
+ | |||
** | ** | ||
Line 96: | Line 100: | ||
Hint: try using a helper function. | Hint: try using a helper function. | ||
+ | |||
+ | Hint 2: consider trying to make the decision about whether to drop a particular item from the list after recursively calling eliminate-larger on the rest after that one -- it's easier. | ||
=== get-nth === | === get-nth === |