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... nitions:
(define item 1)
(define mylist '(1 2))
The following tester expressions represent the 4 possible ways to order item and mylist
with cons.
Copy/paste them into your definiti... r '(cons item item))
(tester '(cons item mylist))
(tester '(cons mylist item))
(tes
===
~~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
02-202051:102-lec16.pptx |Today's lecture: Java's List Implementations and the Abstract Data Type (ADT)}... utube.com/watch?v=_T06nsDRlbQ|What am I currently listening to?]]
* [[https://www.youtube.com/watch?v=jM8dCGIm6yc|What else am I listening to? Throat Music!]]
==== Wednesday ===... pu102-remotelab2.txt |Instructions for the linked list lab (LLL)}}
* I'm separating out the individual
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 \\
2: Create a class BankingSystem that maintains a list of account objects of class BankAccount that impl... . Have main() ask the banking system to print the list, to sort the list on increasing balance, and to print the list again. Keep it simple, do not add unneeded features. This
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
pu102-remotelab2.txt |Instructions for the linked list lab (LLL)}}
* I'm separating out the individual... mitting your lab.
* {{ :courses:cs102-202051:ilist.java |Java sourcefile IList.java, the interface}}
* {{ :courses:cs102-202051:mylinkedlist.java |Java source file MyLinkedList.java - please
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 }}