functions that computes all the permutations of a list of numbers
* Be sure to write tests for each fu... , before you move on to the function of your wish list
* Have a total of four functions by the time yo... --
==== Background ====
The permutations of a list of numbers is the list of all possible sequences of those numbers. We will represent the permutations o
;
}
</style>
<h1 id="assignment-5-much-ado-about-lists">Assignment 5: Much Ado About Lists</h1>
<p><strong>Assigned</strong>: Thursday, 6 October <br />
<str... ems, we will tell you whether to use the built-in list operations (like <code>map</code> and <code>filte... i>
<li><a href="https://www.pyret.org/docs/latest/lists.html">List documentation</a></li>
<li><a href="h
g, understanding, and writing functions involving lists and recursion.
====== Setup =====
Create the fi... '' and copy/paste the following into it:
''import lists as L''
As usual, ask your instructor or a coach... (e.g., ''my-sum'').
<code>
fun my-product(lst :: List<Number>) -> Number:
doc: ```returns the product of the numbers in list lst```
cases (List) lst:
| empty => 1
|
g, understanding, and writing functions involving lists and recursion.
====== Setup =====
Create the fi... '' and copy/paste the following into it:
''import lists as L''
As usual, ask your instructor or a coach... (e.g., ''my-sum'').
<code>
fun my-product(lst :: List<Number>) -> Number:
doc: ```returns the product of the numbers in list lst```
cases (List) lst:
| empty => 1
|
e familiar with DrRacket procedures
* Use cons, list and append
* Use map
* Use let*
=== Procedu... xpressions such as "(1 . 1)" are
called "dotted lists". They do *not* represent well-formed lists.
Write a similar set of expressions for the built-in LIST and APPEND functions.
Review the definitions fo
===
~~NOTOC~~
==== Sorting / More Practice with Lists ====
**The main purpose of this lab is to have:**
* More practice with lists: lists of strings and lists of structures (posn's)
* More practice with sorting
* More practice designin
, which will require working with both tables and lists. As you work on each part of the lab, you’ll pra... n this lab we will use what we know about tables, lists, and functions to visualize these squirrel sight... href="https://dcic-world.org/2022-01-25/tables-to-lists.html#%28part._.Lambda__.Anonymous_.Functions%29"... n the table itself, let’s pull them out and get a list of all the free-text observations.</p>
<div clas
amples for this lab ====
A **''toast''** and **''list-of-toast''** are defined as follows:
(define-s... but not limited to) “white” or “wheat”.
\\
; A list-of-toast (lot) is either
; - '()
; - (cons toast lot)
\\ Here's an example of a **''list-of-toast''** that you should use in your examples... tions you write: \\
<code scheme>
(define toast-list
(list (make-toast "white" 0)
(make-toas
r course materials for that week. The last column lists the sections in //Data-Centric Introduction to C... pond to the lecture material. The Mon/Wed columns list the lecture dates, and the Fri column lists the lab dates, for each week of the semester. The two midte... |-6-]]** | @LightBlue: Lists | @LightBlue: 10/3 \\
r course materials for that week. The last column lists the sections in //Data-Centric Introduction to C... pond to the lecture material. The Mon/Wed columns list the lecture dates, and the Fri column lists the lab dates, for each week of the semester. The midterm e... @LightBlue: 2/8 \\ {{ 2023-02-08.pdf | Tables and lists}} \\ [[https://code.pyret.org/editor#share=1i7e
r course materials for that week. The last column lists the sections in //Data-Centric Introduction to C... pond to the lecture material. The Mon/Wed columns list the lecture dates, and the Fri column lists the lab dates, for each week of the semester. The two midte... | @LightBlue: Lists \\ {{ 2021-10-06.pdf }}
Moving between directories with <code>cd</code>. Listing files with
<code>ls</code>. Your first pro... e> or <code>cond</code>. Introducing <b>non-empty lists</b>. <code>first</code> and
<code>rest</code... code>and</code> and <code>or</code>. Constructing lists with <code>cons</code>.
<hr>
<center>
... accumulators and wrapper functions. Returning to lists and list recursion.
<hr>
<center>
<b
r course materials for that week. The last column lists the sections in //Data-Centric Introduction to C... pond to the lecture material. The Mon/Wed columns list the lecture dates, and the Fri column lists the lab dates, for each week of the semester. The two midte... | @LightBlue: Lists
BSET?, that takes two inputs, AA and BB, that are lists representing sets. The function should return #t... CTION, that takes two inputs, AA and BB, that are lists representing sets.
The function should return a list representing the INTERSECTION of the two input lists. Note: If the input lists do not have any duplica